Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
meta = {
nixpkgs = pkgsFor defaultSystem;
nodeNixpkgs = nixpkgs.lib.mapAttrs (name: pkgsFor) overrideSystem;
specialArgs = { inherit inputs; };
specialArgs = { inherit self inputs; };
};
});

Expand Down
20 changes: 19 additions & 1 deletion profiles/base.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
{ pkgs, lib, inputs, config, ... }:
{ self, pkgs, lib, inputs, config, ... }:

let
secretsDir = inputs.self + "/secrets";
hostKeyFile = secretsDir + "/host-keys/${config.networking.hostName}.pub";
variant_id =
if config.system.nixos.variant_id != null then
config.system.nixos.variant_id
else
"ocf";
gitRev =
if (self ? shortRev ) then
self.shortRev
else if (self ? dirtyShortRev) then
self.dirtyShortRev
else "nullrev";
in

{
system.configurationRevision = gitRev;
# we do not include self.lastModifiedDate since:
# - the bootloader menu already includes "built on"
# - date can be checked from the revision hash with an extra step
# - label is much shorter without the date
system.nixos.label = "${variant_id}.${gitRev}.${config.system.nixos.version}";

nix = {
channel.enable = false;
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
Expand Down
1 change: 1 addition & 0 deletions profiles/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ in

# Colmena tagging
deployment.tags = [ "desktop" ];
system.nixos.variant_id = "ocf-desktop";

ocf = {
# TODO: need ensure host keys can't be stolen by booting an external drive...
Expand Down
Loading