[Nix-dev] why has each revision / generation not a own configuration.nix

Bas van Dijk v.dijk.bas at gmail.com
Wed May 17 01:20:45 CEST 2017


Op 16 mei 2017 18:43 schreef "zimbatm" <zimbatm at zimbatm.com>:

How do you find back which git revision was used to produce a given NixOS
profile?

At LumiGuide I use the following module for that:

{ config, lib, ... }:

with lib;

{
  options.system = {
    lumiRevision = mkOption {
      internal = true;
      type = types.str;
      default = lib.commitIdFromGitRepo <lumi/.git>;
      description = ''
        The git revision of the lumi repository that was used to
configure this machine.
      '';
    };
  };
  config = {
    environment.etc."lumi-revision".text = config.system.lumiRevision;

    system.nixosLabel = "nixos-" + config.system.nixosVersion
                      + "_lumi-" + config.system.lumiRevision;
  };
}


On Sat, 13 May 2017, 14:34 Profpatsch, <mail at profpatsch.de> wrote:

> On 17-05-13 12:25pm, Layus wrote:
> > On 13/05/17 12:14, Leo Gaspard wrote:
> > See the previous ML discussion on that topic where we proposed to keep it
> > opt-in, but with an apt-out config line in the default configuration.nix.
> > This may already be implemented.
>
> The ones who don’t keep their sources under version control
> deserve their eventual fate.
>
> Seriously, copying & pasting default templates around
> is not a good idea.
> I haven’t seen a “default” configuration.nix (whatever that is)
> in more than 1.5 years.
>
> We already have the firewall enabled by default,
> even that has been a major discussion,
> because for everything that is implicit
> you have to remember to turn it off.
>
> --
> Proudly written in Mutt with Vim on NixOS.
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
> May take up to five days to read your message. If it’s urgent, call me.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>

_______________________________________________
nix-dev mailing list
nix-dev at lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170517/a9bf85bf/attachment.html>


More information about the nix-dev mailing list