selfprivacy-nixos-config/flake.nix
Alexander Tomokhov b9dad899de pass /etc/nixos folder as an input to override
This way it is expected to have access to this path from build results,
making it possible to reproduce the build.
2023-11-08 16:27:52 +04:00

42 lines
1 KiB
Nix

{
description = "Selfprivacy NixOS configuration flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
selfprivacy-overlay.url =
"git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git";
# the /etc/nixos folder input is expected to be set by the caller
# for example, upon nix build using --override-input
etc-nixos.flake = false;
};
outputs =
{ self
, etc-nixos
, nixpkgs
, selfprivacy-overlay
}:
let
system = "x86_64-linux";
userdata =
builtins.fromJSON (builtins.readFile "${etc-nixos}/userdata.json");
in
{
nixosConfigurations = {
just-nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit system userdata; };
modules = [
# SelfPrivacy overlay
{ nixpkgs.overlays = [ selfprivacy-overlay.overlay ]; }
# machine specifics
"${etc-nixos}/hardware-configuration.nix"
# main configuration part
./configuration.nix
];
};
};
};
}