Compare commits

..

4 Commits

Author SHA1 Message Date
Abhinav Sarkar 5059cf6555 Formats files 2024-01-31 19:23:23 +05:30
Abhinav Sarkar 7bb772ebc8 Splits system config into separate file 2024-01-31 19:21:33 +05:30
Abhinav Sarkar d8c4b1b209 flake.lock: Update
Flake lock file updates:

• Updated input 'home-manager':
    'github:nix-community/home-manager/3df2a80f3f85f91ea06e5e91071fa74ba92e5084' (2024-01-23)
  → 'github:nix-community/home-manager/d634c3abafa454551f2083b054cd95c3f287be61' (2024-01-28)
• Updated input 'nix-darwin':
    'github:LnL7/nix-darwin/4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d' (2023-11-24)
  → 'github:LnL7/nix-darwin/91b9daf672c957ef95a05491a75f62e6a01d5aaf' (2024-01-30)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/5f5210aa20e343b7e35f40c033000db0ef80d7b9' (2024-01-22)
  → 'github:nixos/nixpkgs/222c1940fafeda4dea161858ffe6ebfc853d3db5' (2024-01-30)
2024-01-31 16:02:50 +05:30
Abhinav Sarkar a094a4d07b Adds Homebrew support and packages 2024-01-31 16:00:03 +05:30
10 changed files with 66 additions and 80 deletions

View File

@ -1,46 +1 @@
{ pkgs, inputs, ... }:
{
imports = [./nix.nix];
security.pam.enableSudoTouchIdAuth = true;
system = {
defaults = {
dock = {
appswitcher-all-displays = false;
autohide = true;
magnification = true;
mru-spaces = false;
orientation = "bottom";
wvous-bl-corner = 13;
wvous-br-corner = 14;
wvous-tl-corner = 2;
wvous-tr-corner = 3;
};
finder = {
AppleShowAllExtensions = true;
FXPreferredViewStyle = "Nlsv";
};
NSGlobalDomain = {
AppleEnableMouseSwipeNavigateWithScrolls = true;
AppleEnableSwipeNavigateWithScrolls = true;
AppleICUForce24HourTime = true;
AppleInterfaceStyle = "Dark";
AppleInterfaceStyleSwitchesAutomatically = false;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = true;
NSAutomaticSpellingCorrectionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = true;
_HIHideMenuBar = true;
};
trackpad = {
Clicking = true;
TrackpadRightClick = true;
};
};
keyboard = {
enableKeyMapping = true;
remapCapsLockToControl = true;
};
stateVersion = 4;
};
}
{ pkgs, inputs, ... }: { imports = [ ./nix.nix ./system.nix ]; }

View File

@ -40,8 +40,7 @@
inherit system;
config = { allowUnfree = true; };
};
in
{
in {
darwinConfigurations."Abhinavs-MacBook-Pro" = nix-darwin.lib.darwinSystem {
inherit system;
specialArgs = { inherit inputs; };

View File

@ -12,6 +12,7 @@
};
casks = [
"amethyst"
"appcleaner"
"calibre"
"dropbox"
"fanny"

View File

@ -1,5 +1,4 @@
{ config, pkgs, inputs, ... }:
{
{ config, pkgs, inputs, ... }: {
services.nix-daemon.enable = true;
nix = {
package = pkgs.nixFlakes;
@ -26,7 +25,7 @@
max-jobs = 6;
min-free = 128000000;
warn-dirty = false;
trusted-users = ["@admin"];
trusted-users = [ "@admin" ];
};
};
nixpkgs = {

View File

@ -12,23 +12,8 @@ let
statix
cachix
];
networkingPackages = with pkgs; [
curl
dig
httpie
openssh
mosh
];
cmdLineUtilPackages = with pkgs; [
bash
broot
coreutils-full
fd
gnugrep
less
ranger
tree
];
networkingPackages = with pkgs; [ curl dig httpie openssh mosh ];
cmdLineUtilPackages = with pkgs; [ bash broot coreutils-full fd gnugrep less ranger tree ];
miscPackages = with pkgs; [
binutils
cabal2nix

View File

@ -1,4 +1,4 @@
{ inputs, config, pkgs, ... }:
{ inputs, config, osConfig, pkgs, ... }:
let username = config.home.username;
in {
@ -25,6 +25,14 @@ in {
interactiveShellInit = ''
fzf_configure_bindings --git_status=\cs --history=\cr --variables=\cv --directory=\cf --git_log=\cg
neofetch
if test -d (brew --prefix)"/share/fish/completions"
set -p fish_complete_path (brew --prefix)/share/fish/completions
end
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
end
'';
shellInit = ''
@ -32,7 +40,7 @@ in {
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /etc/profiles/per-user/${username}/etc/profile.d/hm-session-vars.sh
fish_add_path -m ~/.local/bin ~/.cabal/bin /etc/profiles/per-user/${username}/bin
eval "$(/usr/local/bin/brew shellenv)"
eval "$(${osConfig.homebrew.brewPrefix}/brew shellenv)"
'';
};
}

View File

@ -156,7 +156,7 @@ in {
"[json]" = { editor.defaultFormatter = "esbenp.prettier-vscode"; };
"[python]" = { editor.defaultFormatter = "ms-python.black-formatter"; };
black-formatter.args = ["--line-length" "100"];
black-formatter.args = [ "--line-length" "100" ];
};
keybindings = [

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
let
rc = pkgs.callPackage ./report-hm-changes.nix { inherit config pkgs; };
in {
home.packages = [ rc ];
}
let rc = pkgs.callPackage ./report-hm-changes.nix { inherit config pkgs; };
in { home.packages = [ rc ]; }

View File

@ -1,9 +1,7 @@
{ config, pkgs, ... }:
let
profiles = "/nix/var/nix/profiles/per-user/${config.home.username}/profile-*-link";
in
pkgs.writeShellScriptBin "report-hm-changes" ''
let profiles = "/nix/var/nix/profiles/per-user/${config.home.username}/profile-*-link";
in pkgs.writeShellScriptBin "report-hm-changes" ''
# Disable nvd if there are less than 2 hm profiles.
if [ $(/bin/ls -d1v ${profiles} 2>/dev/null | wc -l) -lt 2 ]; then
echo "Skipping changes report..."

44
system.nix Normal file
View File

@ -0,0 +1,44 @@
{ pkgs, inputs, ... }: {
security.pam.enableSudoTouchIdAuth = true;
system = {
defaults = {
dock = {
appswitcher-all-displays = false;
autohide = true;
magnification = true;
mru-spaces = false;
orientation = "bottom";
wvous-bl-corner = 13;
wvous-br-corner = 14;
wvous-tl-corner = 2;
wvous-tr-corner = 3;
};
finder = {
AppleShowAllExtensions = true;
FXPreferredViewStyle = "Nlsv";
};
NSGlobalDomain = {
AppleEnableMouseSwipeNavigateWithScrolls = true;
AppleEnableSwipeNavigateWithScrolls = true;
AppleICUForce24HourTime = true;
AppleInterfaceStyle = "Dark";
AppleInterfaceStyleSwitchesAutomatically = false;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = true;
NSAutomaticSpellingCorrectionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = true;
_HIHideMenuBar = true;
};
trackpad = {
Clicking = true;
TrackpadRightClick = true;
};
};
keyboard = {
enableKeyMapping = true;
remapCapsLockToControl = true;
};
stateVersion = 4;
};
}