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-11-08 14:32:30 +00:00
|
|
|
} @ inputs:
|
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-11-08 14:32:30 +00:00
|
|
|
lib = nixpkgs.legacyPackages.${system}.lib;
|
2023-07-15 12:52:46 +00:00
|
|
|
in
|
|
|
|
{
|
2023-11-08 14:32:30 +00:00
|
|
|
nixosConfigurations.just-nixos = nixpkgs.lib.nixosSystem {
|
|
|
|
specialArgs = { inherit system userdata; };
|
|
|
|
modules = [
|
|
|
|
# SelfPrivacy overlay
|
|
|
|
{
|
|
|
|
nixpkgs.overlays = [ selfprivacy-overlay.overlay ];
|
|
|
|
environment.etc.selfprivacy-nixos-config-source.source =
|
|
|
|
etc-nixos.outPath;
|
|
|
|
nix.registry = lib.mapAttrs (_n: flake: { inherit flake; }) inputs;
|
|
|
|
}
|
|
|
|
# machine specifics
|
|
|
|
"${etc-nixos}/hardware-configuration.nix"
|
|
|
|
# main configuration part
|
|
|
|
./configuration.nix
|
|
|
|
];
|
2023-07-15 12:52:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|