my NixOS and nix-darwin config
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

mkIf

+324 -44
+90
flake.lock
··· 1 + { 2 + "nodes": { 3 + "darwin": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1765065051, 11 + "narHash": "sha256-b7W9WsvyMOkUScNxbzS45KEJp0iiqRPyJ1I3JBE+oEE=", 12 + "owner": "LnL7", 13 + "repo": "nix-darwin", 14 + "rev": "7e22bf538aa3e0937effcb1cee73d5f1bcc26f79", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "LnL7", 19 + "repo": "nix-darwin", 20 + "type": "github" 21 + } 22 + }, 23 + "home-manager": { 24 + "inputs": { 25 + "nixpkgs": [ 26 + "nixpkgs" 27 + ] 28 + }, 29 + "locked": { 30 + "lastModified": 1764998300, 31 + "narHash": "sha256-fZatn/KLfHLDXnF0wy7JxXqGaZmGDTVufT4o/AOlj44=", 32 + "owner": "nix-community", 33 + "repo": "home-manager", 34 + "rev": "27a6182347ccae90a88231ae0dc5dfa7d15815bb", 35 + "type": "github" 36 + }, 37 + "original": { 38 + "owner": "nix-community", 39 + "repo": "home-manager", 40 + "type": "github" 41 + } 42 + }, 43 + "nixpkgs": { 44 + "locked": { 45 + "lastModified": 1764950072, 46 + "narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", 47 + "owner": "nixos", 48 + "repo": "nixpkgs", 49 + "rev": "f61125a668a320878494449750330ca58b78c557", 50 + "type": "github" 51 + }, 52 + "original": { 53 + "owner": "nixos", 54 + "ref": "nixos-unstable", 55 + "repo": "nixpkgs", 56 + "type": "github" 57 + } 58 + }, 59 + "root": { 60 + "inputs": { 61 + "darwin": "darwin", 62 + "home-manager": "home-manager", 63 + "nixpkgs": "nixpkgs", 64 + "rust-overlay": "rust-overlay" 65 + } 66 + }, 67 + "rust-overlay": { 68 + "inputs": { 69 + "nixpkgs": [ 70 + "nixpkgs" 71 + ] 72 + }, 73 + "locked": { 74 + "lastModified": 1765161692, 75 + "narHash": "sha256-XdY9AFzmgRPYIhP4N+WiCHMNxPoifP5/Ld+orMYBD8c=", 76 + "owner": "oxalica", 77 + "repo": "rust-overlay", 78 + "rev": "7ed7e8c74be95906275805db68201e74e9904f07", 79 + "type": "github" 80 + }, 81 + "original": { 82 + "owner": "oxalica", 83 + "repo": "rust-overlay", 84 + "type": "github" 85 + } 86 + } 87 + }, 88 + "root": "root", 89 + "version": 7 90 + }
+28 -25
flake.nix
··· 25 25 26 26 # Flake outputs 27 27 outputs = { self, darwin, nixpkgs, home-manager, rust-overlay, ... }@inputs: 28 - let 29 - overlays = [ rust-overlay.overlays.default ]; 30 - mkPkgs = system: 31 - import nixpkgs { 32 - inherit system overlays; 33 - config.allowUnfree = true; 34 - }; 35 - 28 + let overlays = [ rust-overlay.overlays.default ]; 36 29 in { 37 - 38 30 # NixOS configuration entrypoint 39 31 # Available through 'nixos-rebuild --flake .#your-hostname' 32 + # `sudo nixos-rebuild switch --flake .#Khaos` 40 33 nixosConfigurations = { 41 34 Khaos = nixpkgs.lib.nixosSystem { 42 - modules = [ ./hosts/Khaos { nixpkgs.overlays = overlays; } ]; 35 + specialArgs = { 36 + inherit inputs; 37 + outputs = self; 38 + }; 39 + modules = [ 40 + ./hosts/Khaos 41 + 42 + { nixpkgs.overlays = overlays; } 43 + home-manager.darwinModules.home-manager 44 + { 45 + home-manager = { 46 + useGlobalPkgs = true; 47 + useUserPackages = true; 48 + users.suri = import ./users/suri/Khaos.nix; 49 + backupFileExtension = "backup"; 50 + }; 51 + } 52 + 53 + ]; 43 54 }; 44 55 }; 45 56 57 + # `darwin-rebuild switch --flake .#Daedalus` 46 58 darwinConfigurations = { 47 59 Daedalus = darwin.lib.darwinSystem { 48 - system = "aarch64-darwin"; # or x86_64-darwin 60 + system = "aarch64-darwin"; 61 + specialArgs = { 62 + inherit inputs; 63 + outputs = self; 64 + }; 49 65 modules = [ 50 66 ./hosts/Daedalus 51 67 { nixpkgs.overlays = overlays; } ··· 54 70 home-manager = { 55 71 useGlobalPkgs = true; 56 72 useUserPackages = true; 57 - users.suri = import ./users/suri; 73 + users.suri = import ./users/suri/Deadalus.nix; 58 74 backupFileExtension = "backup"; 59 - 60 75 }; 61 76 } 62 77 ]; 63 - }; 64 - }; 65 - 66 - homeConfigurations = { 67 - "suri@Daedalus" = home-manager.lib.homeManagerConfiguration { 68 - pkgs = mkPkgs "aarch64-darwin"; 69 - modules = [ ./users/suri/Daedalus.nix ]; 70 - }; 71 - 72 - "suri@Khaos" = home-manager.lib.homeManagerConfiguration { 73 - pkgs = mkPkgs "x86_64-linux"; 74 - modules = [ ./users/suri/Khaos.nix ]; 75 78 }; 76 79 }; 77 80
+95
hosts/Daedalus/default.nix
··· 1 + { pkgs, config, outputs, ... }: { 2 + 3 + # List packages installed in system profile. To search by name, run: 4 + # $ nix-env -qaP | grep wget 5 + # dont remove zellij and fzf, just trust me 6 + environment.systemPackages = with pkgs; [ vim git nh zellij fzf ]; 7 + 8 + system.primaryUser = "suri"; 9 + 10 + fonts.packages = [ pkgs.monaspace ]; 11 + 12 + 13 + 14 + 15 + 16 + homebrew = { 17 + enable = true; 18 + brews = [ 19 + "sketchybar" 20 + "mas" 21 + "borders" 22 + "libiconv" 23 + "oh-my-posh" 24 + "ifstat" 25 + "libiconv" 26 + # for twizzler 27 + "qemu" 28 + "e2fsprogs" 29 + "spicetify-cli" 30 + "ninja" 31 + 32 + ]; 33 + casks = [ 34 + "ghostty@tip" 35 + "google-chrome" 36 + "db-browser-for-sqlite" 37 + 38 + "notion" 39 + "orbstack" 40 + "zen" 41 + "discord" 42 + "slack" 43 + "zulip" 44 + "raycast" 45 + "blender" 46 + "godot" 47 + "zoom" 48 + "soduto" 49 + "font-hack-nerd-font" 50 + "font-sf-pro" 51 + "font-fira-code-nerd-font" 52 + "spotify" 53 + "obsidian" 54 + "mac-mouse-fix" 55 + ]; 56 + masApps = { "whatsapp" = 310633997; }; 57 + onActivation = { 58 + autoUpdate = true; 59 + upgrade = true; 60 + # cleanup = "zap"; 61 + }; 62 + }; 63 + 64 + system.defaults = { 65 + dock.autohide = true; 66 + loginwindow.GuestEnabled = false; 67 + NSGlobalDomain.AppleInterfaceStyle = "Dark"; 68 + NSGlobalDomain.KeyRepeat = 2; 69 + # NSGlobalDomain._HIHideMenuBar = true; sketchy bar tmoapita to figure out rn 70 + NSGlobalDomain.NSWindowShouldDragOnGesture = true; 71 + finder.FXPreferredViewStyle = "clmv"; 72 + }; 73 + 74 + # Necessary for using flakes on this system. 75 + nix.settings.experimental-features = "nix-command flakes"; 76 + nix.enable = false; 77 + # Set Git commit hash for darwin-version. 78 + system.configurationRevision = outputs.rev or outputs.dirtyRev or null; 79 + 80 + nixpkgs.config.allowUnfree = true; 81 + 82 + # Used for backwards compatibility, please read the changelog before changing. 83 + # $ darwin-rebuild changelog 84 + system.stateVersion = 6; 85 + 86 + security.pam.services.sudo_local.touchIdAuth = true; 87 + 88 + # The platform the configuration will be used on. 89 + nixpkgs.hostPlatform = "aarch64-darwin"; 90 + 91 + users.users.suri = { 92 + name = "suri"; 93 + home = "/Users/suri"; 94 + }; 95 + }
+15 -15
hosts/Khaos/configuration.nix
··· 122 122 setSocketVariable = true; 123 123 }; 124 124 125 - home-manager = { 126 - extraSpecialArgs = { inherit inputs outputs; }; 127 - backupFileExtension = "backup"; 128 - users = { 129 - # Import your home-manager configuration 130 - suri = import ../../users/suri/home.nix; 131 - }; 132 - }; 125 + # home-manager = { 126 + # extraSpecialArgs = { inherit inputs outputs; }; 127 + # backupFileExtension = "backup"; 128 + # users = { 129 + # # Import your home-manager configuration 130 + # suri = import ../../users/suri/home.nix; 131 + # }; 132 + # }; 133 133 134 - # Define a user account. Don't forget to set a password with ‘passwd’. 135 - users.users.suri = { 136 - isNormalUser = true; 137 - description = "suri"; 138 - extraGroups = [ "networkmanager" "wheel" ]; 139 - packages = with pkgs; [ ]; 140 - }; 134 + # # Define a user account. Don't forget to set a password with ‘passwd’. 135 + # users.users.suri = { 136 + # isNormalUser = true; 137 + # description = "suri"; 138 + # extraGroups = [ "networkmanager" "wheel" ]; 139 + # packages = with pkgs; [ ]; 140 + # }; 141 141 # Open ports in the firewall. 142 142 networking.firewall.allowedTCPPorts = [ 22 ]; 143 143
+21
modules/home/term/ghostty/default.nix
··· 1 + { lib, pkgs, config, ... }: 2 + with lib; 3 + let cfg = config.programs.ghostty; 4 + in { 5 + options.programs.aerospace = { enable = mkEnableOption "Ghostty Terminal"; }; 6 + 7 + config = mkIf (cfg.enable && pkgs.stdenv.isDarwin) { 8 + home.packages = [ pkgs.ghostty-bin ]; 9 + 10 + home.file = { 11 + # REMEMBER to lift the config file out, and refacts this after kenric puts his config 12 + # on the public internet, study and refactor my dotfiles! 13 + 14 + "${config.home.homeDirectory}/.config/ghostty".source = 15 + config.lib.file.mkOutOfStoreSymlink 16 + "${config.home.homeDirectory}/Nyx/ghostty"; 17 + 18 + }; 19 + }; 20 + } 21 +
+24 -4
modules/home/wm/aerospace/default.nix
··· 1 - { pkgs, stdenv, ... }: 1 + { lib, pkgs, config, ... }: 2 2 3 - { 4 - home.file.".aerospace.toml" = 5 - pkgs.lib.mkIf pkgs.stdenv.isDarwin { source = ./aerospace.toml; }; 3 + with lib; 4 + let cfg = config.programs.aerospace; 5 + in { 6 + options.programs.aerospace = { 7 + enable = mkEnableOption "AeroSpace window manager"; 8 + }; 9 + 10 + config = mkIf (cfg.enable && pkgs.stdenv.isDarwin) { 11 + home.packages = [ pkgs.aerospace ]; 12 + 13 + home.file.".aerospace.toml".source = ./aerospace.toml; 14 + 15 + launchd.agents.aerospace = { 16 + enable = true; 17 + config = { 18 + ProgramArguments = [ "${pkgs.aerospace}/bin/aerospace" ]; 19 + KeepAlive = true; 20 + RunAtLoad = true; 21 + StandardOutPath = "/tmp/aerospace.out.log"; 22 + StandardErrorPath = "/tmp/aerospace.err.log"; 23 + }; 24 + }; 25 + }; 6 26 }
+8
users/suri/Deadalus.nix
··· 1 + { 2 + 3 + imports = [ ./common.nix ../../modules/home/wm/aerospace ]; 4 + 5 + programs.aerospace.enable = true; 6 + programs.ghostty.enable = true; 7 + 8 + }
+6
users/suri/Khaos.nix
··· 1 + { ... }: 2 + { 3 + 4 + 5 + 6 + }
+37
users/suri/common.nix
··· 1 + { config, ... }: 2 + let 3 + 4 + OOS = path: config.lib.file.mkOutOfStoreSymlink path; 5 + 6 + in { 7 + 8 + # imports = [ ./apps ]; 9 + # 10 + imports = [ 11 + 12 + ../../modules/home/prompts/oh-my-posh 13 + ../../modules/home/shells/zsh 14 + ../../modules/home/term/ghostty 15 + ../../modules/home/tools 16 + 17 + ]; 18 + 19 + programs.direnv = { 20 + enable = true; 21 + enableZshIntegration = true; 22 + nix-direnv.enable = true; 23 + }; 24 + 25 + home.file = { 26 + # REMEMBER to lift the config file out, and refacts this after kenric puts his config 27 + # on the public internet, study and refactor my dotfiles! 28 + "Library/Application Support/com.mitchellh.ghostty".source = 29 + OOS "${config.home.homeDirectory}/dev/dots/apps/ghostty"; 30 + 31 + }; 32 + 33 + # The state version is required and should stay at the version you 34 + # originally installed. 35 + home.stateVersion = "25.05"; 36 + } 37 +