From 1fbb779c9a1f8c399a5f3c7ac99af44e1ec347f5 Mon Sep 17 00:00:00 2001 From: osbm Date: Thu, 17 Oct 2024 00:19:19 +0300 Subject: [PATCH] also save git hash to nixos generations --- README.md | 2 +- configuration.nix | 3 ++- flake.nix | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2845567..792caac 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The nix configuration of mine. I am trying to find a very suitable workplace for But There are couple of things i need to do before: -- [ ] add git hash to the nixos build generations +- [x] add git hash to the nixos build generations - [ ] fix cuda drivers - [ ] fix nvidia-smi command - [ ] compile a cuda program successfully diff --git a/configuration.nix b/configuration.nix index 505b026..19774ec 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, pkgs-unstable, ... }: +{ config, pkgs, pkgs-unstable, system-label, ... }: { imports = @@ -182,6 +182,7 @@ # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. # networking.firewall.enable = false; + system.nixos.label = system-label; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/flake.nix b/flake.nix index 720795f..c22eac7 100644 --- a/flake.nix +++ b/flake.nix @@ -14,15 +14,16 @@ ... }: { nixosConfigurations = { - revision = self.shortRev or self.dirtyShortRev or self.lastModified or "unknown"; + # revision = self.shortRev or self.dirtyShortRev or self.lastModified or "unknown"; tartarus = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; modules = [ ./configuration.nix ]; specialArgs = { - pkgs-unstable = import nixpkgs-unstable { + pkgs-unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; }; + system-label = self.shortRev or self.dirtyShortRev or self.lastModified or "unknown"; }; }; };