diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..82f0f09 --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager/release-24.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake-compat.url = "github:edolstra/flake-compat"; + }; + + outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, ... }: + let + system = "x86_64-linux"; + + machines = [ + "corsac" + ]; + + packageSets = let + pkgsInputs = { inherit system; config = import ./config.nix; }; + in rec { + pkgs = import nixpkgs pkgsInputs; + unstablePkgs = import nixpkgs-unstable pkgsInputs; + auxiliaryPkgs = import ./pkgs { inherit pkgs unstablePkgs; }; + }; + + in { + nixosConfigurations = nixpkgs.lib.genAttrs machines + (machine: nixpkgs.lib.nixosSystem { + inherit system; + + specialArgs = inputs // packageSets // { + me = machine; + security = import ./security.nix; + }; + + modules = [ + ./machines/${machine} + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.mel = import ./machines/${machine}/home.nix; + } + ]; + } + ); + + # compatibility wrapper for nixos-option + legacyPackages.${system} = with packageSets; pkgs.recurseIntoAttrs pkgs; + }; +} |
