2023-07-15 12:52:46 +00:00
|
|
|
{
|
|
|
|
description = "Selfprivacy NixOS configuration flake";
|
|
|
|
|
|
|
|
inputs = {
|
2023-07-17 00:58:26 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
2023-08-22 19:08:53 +00:00
|
|
|
|
2023-09-18 13:22:08 +00:00
|
|
|
selfprivacy-overlay.url =
|
2023-07-17 00:58:26 +00:00
|
|
|
"git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git";
|
2023-08-22 19:08:53 +00:00
|
|
|
|
2023-11-08 12:04:50 +00:00
|
|
|
# the /etc/nixos folder input is expected to be set by the caller
|
2023-08-22 19:08:53 +00:00
|
|
|
# for example, upon nix build using --override-input
|
2023-11-08 12:04:50 +00:00
|
|
|
etc-nixos.flake = false;
|
2023-07-15 12:52:46 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 19:08:53 +00:00
|
|
|
outputs =
|
|
|
|
{ self
|
2023-11-08 12:04:50 +00:00
|
|
|
, etc-nixos
|
2023-08-22 19:08:53 +00:00
|
|
|
, nixpkgs
|
2023-09-18 13:22:08 +00:00
|
|
|
, selfprivacy-overlay
|
2023-08-22 19:08:53 +00:00
|
|
|
}:
|
2023-07-15 12:52:46 +00:00
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
2023-11-08 12:04:50 +00:00
|
|
|
userdata =
|
|
|
|
builtins.fromJSON (builtins.readFile "${etc-nixos}/userdata.json");
|
2023-07-15 12:52:46 +00:00
|
|
|
in
|
|
|
|
{
|
2023-08-22 16:32:25 +00:00
|
|
|
nixosConfigurations = {
|
2023-07-15 12:52:46 +00:00
|
|
|
just-nixos = nixpkgs.lib.nixosSystem {
|
2023-08-22 21:41:39 +00:00
|
|
|
specialArgs = { inherit system userdata; };
|
|
|
|
modules = [
|
2023-09-27 19:43:45 +00:00
|
|
|
# SelfPrivacy overlay
|
2023-11-08 12:25:24 +00:00
|
|
|
{
|
|
|
|
nixpkgs.overlays = [ selfprivacy-overlay.overlay ];
|
|
|
|
environment.etc.selfprivacy-nixos-config-source.source =
|
|
|
|
etc-nixos.outPath;
|
|
|
|
}
|
2023-09-27 19:43:45 +00:00
|
|
|
# machine specifics
|
2023-11-08 12:04:50 +00:00
|
|
|
"${etc-nixos}/hardware-configuration.nix"
|
2023-09-27 19:43:45 +00:00
|
|
|
# main configuration part
|
2023-08-22 21:41:39 +00:00
|
|
|
./configuration.nix
|
|
|
|
];
|
2023-07-15 12:52:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|