selfprivacy-nixos-config/flake.nix

49 lines
1.4 KiB
Nix
Raw Normal View History

2023-07-15 15:52:46 +03:00
{
description = "SelfPrivacy NixOS configuration flake";
2023-07-15 15:52:46 +03:00
inputs = {
2023-07-17 03:58:26 +03:00
nixpkgs.url = "github:nixos/nixpkgs";
selfprivacy-graphql-api.url =
"git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git";
selfprivacy-graphql-api.inputs.nixpkgs.follows = "nixpkgs";
2023-07-15 15:52:46 +03:00
};
outputs = { self, nixpkgs, selfprivacy-graphql-api }:
2023-07-15 15:52:46 +03:00
let
system = "x86_64-linux";
in
{
nixosConfigurations-fun =
{ hardware-configuration
, userdata
, top-level-flake
}: {
just-nixos = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit
system
hardware-configuration
userdata;
selfprivacy-graphql-api =
selfprivacy-graphql-api.packages.${system}.default;
};
modules = [
hardware-configuration
./configuration.nix
{
# embed top-level flake source folder into the build
environment.etc."selfprivacy-config-source" =
top-level-flake.outPath;
# for running "nix search nixpkgs", etc
nix.registry.nixpkgs.flake = nixpkgs;
# embed commit sha1; dirty builds are intentionally forbidden
system.configurationRevision = self.rev;
}
];
inherit system;
};
2023-07-15 15:52:46 +03:00
};
};
}