Add initial flake file.

This commit is contained in:
Kevin Baensch 2023-02-06 22:44:12 +01:00
parent 315f401d5f
commit ef7eb5f9e4
Signed by: derped
GPG key ID: C0F1D326C7626543
2 changed files with 241 additions and 0 deletions

199
flake.lock Normal file
View file

@ -0,0 +1,199 @@
{
"nodes": {
"blobs": {
"flake": false,
"locked": {
"lastModified": 1604995301,
"narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=",
"owner": "simple-nixos-mailserver",
"repo": "blobs",
"rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"repo": "blobs",
"type": "gitlab"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"nixpkgs-22_11": "nixpkgs-22_11",
"utils": "utils"
},
"locked": {
"lastModified": 1671738303,
"narHash": "sha256-PRgqtaWf2kMSYqVmcnmhTh+UsC0RmvXRTr+EOw5VZUA=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "6d0d9fb966cc565a3df74d3b686f924c7615118c",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"type": "gitlab"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1670751203,
"narHash": "sha256-XdoH1v3shKDGlrwjgrNX/EN8s3c+kQV7xY6cLCE8vcI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "64e0bf055f9d25928c31fb12924e59ff8ce71e60",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs-22_11": {
"locked": {
"lastModified": 1669558522,
"narHash": "sha256-yqxn+wOiPqe6cxzOo4leeJOp1bXE/fjPEi/3F/bBHv8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ce5fe99df1f15a09a91a86be9738d68fadfbad82",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-22.11",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1675512093,
"narHash": "sha256-u1CY4feK14B57E6T+0Bhkuoj8dpBxCPrWO+SP87UVP8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8e8240194eda25b61449f29bb5131e02b28a5486",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1675556398,
"narHash": "sha256-5Gf5KlmFXfIGVQb2hmiiE7FQHoLd4UtEhIolLQvNB/A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e32c33811815ca4a535a16faf1c83eeb4493145b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1675545634,
"narHash": "sha256-TbQeQcM5TA/wIho6xtzG+inUfiGzUXi8ewwttiQWYJE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0591d6b57bfeb55dfeec99a671843337bc2c3323",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1675545634,
"narHash": "sha256-TbQeQcM5TA/wIho6xtzG+inUfiGzUXi8ewwttiQWYJE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0591d6b57bfeb55dfeec99a671843337bc2c3323",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"mailserver": "mailserver",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1675566616,
"narHash": "sha256-Wki1ffvQUIB044M9ltjOxpXJGsqnQiVQPvMpQ0RiEBE=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "4d16c18787ba8ff80c1ff8db25c5ca56f68ceed3",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1605370193,
"narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5021eac20303a61fafe17224c087f5519baed54d",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

42
flake.nix Normal file
View file

@ -0,0 +1,42 @@
{
description = "NixOS Configuration";
inputs = rec {
nixpkgs.url = "github:/NixOS/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:/NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:/NixOS/nixpkgs/nixos-22.11";
mailserver.url = "gitlab:/simple-nixos-mailserver/nixos-mailserver";
sops-nix = {
url = github:Mic92/sops-nix;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, mailserver, sops-nix, ... }@attrs: let
lib = nixpkgs.lib;
fn = import ./fn.nix { inherit lib; };
system = "x86_64-linux";
machineList = fn.lst { p = (toString ./machines); t = "directory"; b = false; };
configFiles = fn.lst { p = (toString ./config); b = true; };
pkgsFiles = fn.lst { p = (toString ./pkgs); b = true; };
serviceFiles = fn.lst { p = (toString ./services); b = true; };
nixosSystemFor = machine: {
name = machine;
value = let
machinePath = lib.concatStringsSep "/" [(toString ./.) "machines" machine];
machineFiles = fn.lst { p = machinePath; b = true; };
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = attrs;
modules = [
(toString ./options/machine.nix)
sops-nix.nixosModules.sops
] ++ machineFiles
++ configFiles
++ pkgsFiles
++ serviceFiles;
};
};
result = lib.listToAttrs (map nixosSystemFor ["Lilim"]);
in {
nixosConfigurations = lib.listToAttrs (map nixosSystemFor machineList);
};
}