diff options
author | tcmal <me@aria.rip> | 2024-08-23 01:03:50 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-23 01:05:10 +0100 |
commit | 5028503d6d2a21d9e4cb3100a2f9b2795cb5d4bd (patch) | |
tree | 94f38bbdfabc7b2549b97541b4d9880b5eb332e7 /flake.nix |
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cffa90f --- /dev/null +++ b/flake.nix @@ -0,0 +1,62 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + inputs@{ + self, + nixpkgs, + disko, + ... + }: + let + mkPkgs = + system: + let + overlays = [ + # Access helpful variables from nixpkgs + (_: prev: prev // { inherit inputs self; }) + + # Add our custom library functions + (final: prev: prev // { lib = prev.lib // import ./lib.nix final; }) + ]; + in + import nixpkgs { inherit system overlays; }; + + mkSystem = + system: config: + let + pkgs = mkPkgs system; + in + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs self; + lib = pkgs.lib // { + our = import ./lib.nix pkgs; + }; + }; + modules = [ + disko.nixosModules.default + ./modules/kiosk + config + ]; + }; + in + { + devShells.x86_64-linux.default = + let + pkgs = mkPkgs "x86_64-linux"; + in + pkgs.mkShell { buildInputs = with pkgs; [ gnumake ]; }; + + nixosConfigurations = { + g1-bigscreen = mkSystem "x86_64-linux" ./hosts/g1-bigscreen.nix; + }; + }; +} |