Configuration for my NixOS based systems and Home Manager
at odin 101 lines 3.3 kB view raw
1{ 2 description = "Home Manager configuration for noah"; 3 4 inputs = { 5 # Specify the source of Home Manager and Nixpkgs. 6 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; 7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 8 determinite = { 9 url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; 10 inputs.nixpkgs.follows = "nixpkgs"; 11 }; 12 home-manager = { 13 url = "github:nix-community/home-manager/release-25.11"; 14 inputs.nixpkgs.follows = "nixpkgs"; 15 }; 16 pre-commit-hooks.url = "github:cachix/git-hooks.nix"; 17 agenix.url = "github:ryantm/agenix"; 18 }; 19 20 outputs = 21 { 22 self, 23 nixpkgs, 24 nixpkgs-unstable, 25 determinite, 26 home-manager, 27 pre-commit-hooks, 28 agenix, 29 ... 30 }@inputs: 31 let 32 supportedSystems = [ 33 "x86_64-linux" 34 "aarch64-linux" 35 "x86_64-darwin" 36 "aarch64-darwin" 37 ]; 38 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 39 in 40 { 41 nixosConfigurations.odin = inputs.nixpkgs.lib.nixosSystem rec { 42 system = "x86_64-linux"; 43 specialArgs = { 44 inherit inputs; 45 unstable = nixpkgs-unstable.legacyPackages.${system}; 46 }; 47 modules = [ 48 determinite.nixosModules.default 49 ./configuration.nix 50 agenix.nixosModules.default 51 home-manager.nixosModules.home-manager 52 { 53 home-manager.useGlobalPkgs = true; 54 home-manager.useUserPackages = true; 55 home-manager.users.noah = ./home.nix; 56 home-manager.extraSpecialArgs = { 57 inherit inputs; 58 unstable = nixpkgs-unstable.legacyPackages.x86_64-linux; 59 }; 60 61 # Optionally, use home-manager.extraSpecialArgs to pass 62 # arguments to home.nix 63 } 64 ]; 65 }; 66 #homeConfigurations."noah" = home-manager.lib.homeManagerConfiguration { 67 # # Specify your home configuration modules here, for example, 68 # # the path to your home.nix. 69 # modules = [ ./home.nix ]; 70 # # Optionally use extraSpecialArgs 71 # # to pass through arguments to home.nix 72 # extraSpecialArgs = { 73 # inherit inputs; 74 # # TODO(ngp): figure out how to avoid double speccifying the platform here 75 # unstable = nixpkgs-unstable.legacyPackages.x86_64-linux; 76 # }; 77 #}; 78 checks = forAllSystems (system: { 79 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { 80 src = ./.; 81 # If your hooks are intrusive, avoid running on each commit with a default_states like this: 82 # default_stages = ["manual" "push"]; 83 hooks = { 84 nixfmt.enable = true; 85 nil.enable = true; 86 luacheck.enable = true; 87 }; 88 }; 89 }); 90 devShells = forAllSystems (system: { 91 default = nixpkgs.legacyPackages.${system}.mkShell { 92 inherit (self.checks.${system}.pre-commit-check) shellHook; 93 buildInputs = [ 94 nixpkgs.legacyPackages.${system}.nixfmt-rfc-style 95 ] 96 ++ self.checks.${system}.pre-commit-check.enabledPackages; 97 }; 98 }); 99 formatter = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); 100 }; 101}