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