Skip to content

Commit

Permalink
feat: add system rev & disallow systems from dirty trees
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsgirao committed Jun 15, 2024
1 parent f8a62ef commit e91baac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@
};

flake = {
#So nix repl can access `self`, through outputs.self
inherit self;

nixosConfigurations = mkHosts ./hosts;
overlays =
Expand Down
5 changes: 5 additions & 0 deletions modules/core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ in
];


# https://discourse.nixos.org/t/flakes-accessing-selfs-revision/11237/8
# system.configurationRevision = toString (self.shortRev or self.dirtyShortRev or "unknown");
system.configurationRevision =
self.shortRev or (throw "Refusing to build from a dirty Git tree!");
environment.etc."nixos/system-flake".source = self;
environment.etc."nixos/system-revision".text = self.rev;
rg = {
enable = true;
domain = "rafael.ovh";
Expand Down

0 comments on commit e91baac

Please sign in to comment.