aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix62
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;
+ };
+ };
+}