Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread Vince

That's pretty neat!


On 10-04-17 22:04, Layus wrote:

On 10/04/17 19:41, Vince wrote:

Benjamin Herr  schreef op 10 april 2017 19:17:44 CEST:

I've been putting

 environment.etc = {
 nixos-orig.source = ./.;
 };

into my configuration.nix and for my still fairly trivial but at least
somewhat moduralized config it seems to work out all right.


On Thu, 2017-04-06 at 18:12 +0200, Guillaume Maudoux (Layus) wrote:

Hi, system.copySystemConfiguration is far from perfect. As
soon as you modularize your config, you will miss all the
other files. If you want a correct
system.copySystemConfiguration, you really need
https://github.com/NixOS/nix/pull/709. It allows you to
snapshot all the sources of a nix derivation, not just one
file. I tested it back then, and it worked pretty well. --
Layus. On 06/04/17 17:46, ni...@vince.lol wrote:

No I don't have `system.copySystemConfiguration=true` set
:-( Luckily I documented my recent efforts in some gists.
I managed to install NixOS on ZFS here:
https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb94732
61459 And my (yet untested) attempt at PCI passthrough
here:
https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b
87b26 There is still some missing, but nothing I can't
handle, I guess. This is a great time to enable my ZFS
snapshots... :-/ Does anyone know why
`system.copySystemConfiguration` is set to false by
default? It seems like it would be better to default this
to true, right? Or at least have this listed in the
generated config? (`nixos-generate-config`) Anyway, I'll
be okay, thanks folks!! Sincerely, Vince On Thursday,
April 6, 2017 4:58 PM, Sergiu Ivanov
 wrote:

Hi Vince, Thus quoth ni...@vince.lol  at 14:12 on
Thu, Apr 06 2017:

I acidentally removed my
/etc/nixos/configuration.nix is there any way I
can get it back? 


Citing directly from:
http://stackoverflow.com/questions/28603773/recover-accidentally
-deleted-configuration-nix-file  '''
 system.copySystemConfiguration  If enabled, copies
the NixOS configuration file $NIXOS_CONFIG (usually
 /etc/nixos/configuration.nix) to the system store
path.  Type:"boolean"  Default:false  Declared
by:''' Do you happen to have this option set
to true? /me goes and sets it to true on his system
-- Sergiu 




nix-dev mailing list nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev 



nix-dev mailing list nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev 

What does that do, exactly? The entry at 
http://nixos.org/nixos/options.html#environment.etc.%3Cname?%3E.source 
is somewhat lacking... I made a PR at 
https://github.com/NixOS/nixpkgs/pull/24707 . If some of you could 
check it out and give me some feedback that’d be great :-) cheers, Vince 


It defines ./. as the content to be copied into /etc/nixos-orig. This 
means that everything in the same directory as the file where this is 
defined will be copied to the store and made available in 
/etc/nixos-orig. Be careful not to secret files and private keys 
potentially located there, as nixos-rebuild often runs as root and 
will happily copy them to the store.


-- Layus.

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread Ryan Trinkle
Yep, I'm adopting that, too!

On Mon, Apr 10, 2017 at 4:04 PM, Layus  wrote:

> On 10/04/17 19:41, Vince wrote:
>
> Benjamin Herr   schreef op 10 april 2017
> 19:17:44 CEST:
>>
>> I've been putting
>>
>> environment.etc = {
>> nixos-orig.source = ./.;
>> };
>>
>> into my configuration.nix and for my still fairly trivial but at least
>> somewhat moduralized config it seems to work out all right.
>>
>>
>> On Thu, 2017-04-06 at 18:12 +0200, Guillaume Maudoux (Layus) wrote:
>>>
>>>  Hi,
>>>
>>>  system.copySystemConfiguration is far from perfect. As soon as you
>>>  modularize your config, you will miss all the other files.
>>>
>>>  If you want a correct system.copySystemConfiguration, you really
>>>  need
>>>  https://github.com/NixOS/nix/pull/709.
>>>  It allows you to snapshot all the sources of a nix derivation, not
>>>  just
>>>  one file.
>>>
>>>  I tested it back then, and it worked pretty well.
>>>
>>>  -- Layus.
>>>
>>>
>>>  On 06/04/17 17:46, ni...@vince.lol wrote:
>>>
  No I don't have `system.copySystemConfiguration=true` set :-(
  Luckily I documented my recent efforts in some gists.
  I managed to install NixOS on ZFS here:
  https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb94732
  61459
  And my (yet untested) attempt at PCI passthrough here:
  https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b
  87b26
  There is still some missing, but nothing I can't handle, I guess.
  This is a great time to enable my ZFS snapshots... :-/

  Does anyone know why `system.copySystemConfiguration` is set to
  false
  by default? It seems like it would be better to default this to
  true,
  right?
  Or at least have this listed in the generated config?
  (`nixos-generate-config`)

  Anyway, I'll be okay, thanks folks!!

  Sincerely,
  Vince
  On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov
    wrote:
>
>
>  Hi Vince,
>
>  Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
>>
>>
>>  I acidentally removed my /etc/nixos/configuration.nix is there
>>  any way
>>  I can get it back?
>
>
>
>  Citing directly from:
>
>   http://stackoverflow.com/questions/28603773/recover-accidentally
>  -deleted-configuration-nix-file
>
>
>   '''
>   system.copySystemConfiguration
>
>   If enabled, copies the NixOS configuration file $NIXOS_CONFIG
>  (usually
>   /etc/nixos/configuration.nix) to the system store path.
>
>   Type:"boolean"
>
>   Default:false
>
>   Declared by:    level.nix>
>   '''
>
>  Do you happen to have this option set to true?
>
>  /me goes and sets it to true on his system
>
>  --
>  Sergiu



  --

  nix-dev mailing list
  nix-dev@lists.science.uu.nl
  http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>
>>>
>>>  --
>>>
>>>  nix-dev mailing list
>>>  nix-dev@lists.science.uu.nl
>>>  http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>
>> What does that do, exactly? The entry at http://nixos.org/nixos/
> options.html#environment.etc.%3Cname?%3E.source is somewhat lacking... I
> made a PR at https://github.com/NixOS/nixpkgs/pull/24707 . If some of you
> could check it out and give me some feedback that’d be great :-) cheers,
> Vince
>
> It defines ./. as the content to be copied into /etc/nixos-orig. This
> means that everything in the same directory as the file where this is
> defined will be copied to the store and made available in /etc/nixos-orig.
> Be careful not to secret files and private keys potentially located there,
> as nixos-rebuild often runs as root and will happily copy them to the store.
>
> -- Layus.
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread Layus

On 10/04/17 19:41, Vince wrote:

Benjamin Herr  schreef op 10 april 2017 19:17:44 CEST:

I've been putting

 environment.etc = {
 nixos-orig.source = ./.;
 };

into my configuration.nix and for my still fairly trivial but at least
somewhat moduralized config it seems to work out all right.


On Thu, 2017-04-06 at 18:12 +0200, Guillaume Maudoux (Layus) wrote:

Hi, system.copySystemConfiguration is far from perfect. As
soon as you modularize your config, you will miss all the
other files. If you want a correct
system.copySystemConfiguration, you really need
https://github.com/NixOS/nix/pull/709. It allows you to
snapshot all the sources of a nix derivation, not just one
file. I tested it back then, and it worked pretty well. --
Layus. On 06/04/17 17:46, ni...@vince.lol wrote:

No I don't have `system.copySystemConfiguration=true` set
:-( Luckily I documented my recent efforts in some gists.
I managed to install NixOS on ZFS here:
https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb94732
61459 And my (yet untested) attempt at PCI passthrough
here:
https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b
87b26 There is still some missing, but nothing I can't
handle, I guess. This is a great time to enable my ZFS
snapshots... :-/ Does anyone know why
`system.copySystemConfiguration` is set to false by
default? It seems like it would be better to default this
to true, right? Or at least have this listed in the
generated config? (`nixos-generate-config`) Anyway, I'll
be okay, thanks folks!! Sincerely, Vince On Thursday,
April 6, 2017 4:58 PM, Sergiu Ivanov 
wrote:

Hi Vince, Thus quoth  ni...@vince.lol  at 14:12 on
Thu, Apr 06 2017:

I acidentally removed my
/etc/nixos/configuration.nix is there any way I
can get it back? 


Citing directly from:
http://stackoverflow.com/questions/28603773/recover-accidentally
-deleted-configuration-nix-file  '''
 system.copySystemConfiguration  If enabled, copies
the NixOS configuration file $NIXOS_CONFIG (usually
 /etc/nixos/configuration.nix) to the system store
path.  Type:"boolean"  Default:false  Declared
by:''' Do you happen to have this option set
to true? /me goes and sets it to true on his system --
Sergiu 




nix-dev mailing list nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev 



nix-dev mailing list nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev 

What does that do, exactly? The entry at 
http://nixos.org/nixos/options.html#environment.etc.%3Cname?%3E.source 
is somewhat lacking... I made a PR at 
https://github.com/NixOS/nixpkgs/pull/24707 . If some of you could 
check it out and give me some feedback that’d be great :-) cheers, Vince 


It defines ./. as the content to be copied into /etc/nixos-orig. This 
means that everything in the same directory as the file where this is 
defined will be copied to the store and made available in 
/etc/nixos-orig. Be careful not to secret files and private keys 
potentially located there, as nixos-rebuild often runs as root and will 
happily copy them to the store.


-- Layus.

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread Layus

This is pure genious !
Simple and yet powerful. Thanks for sharing :-).
It can be customized with filterSource and such if you want more control.

However, it does not track modifications to nixpkgs.
I have a bad habit of building NixOS from dirty nixpkgs repos to test my 
various fixes.

Any idea to handle that ?

-- Layus.

On 10/04/17 19:17, Benjamin Herr wrote:

I've been putting

 environment.etc = {
 nixos-orig.source = ./.;
 };

into my configuration.nix and for my still fairly trivial but at least
somewhat moduralized config it seems to work out all right.


On Thu, 2017-04-06 at 18:12 +0200, Guillaume Maudoux (Layus) wrote:

Hi,

system.copySystemConfiguration is far from perfect. As soon as you
modularize your config, you will miss all the other files.

If you want a correct system.copySystemConfiguration, you really
need
https://github.com/NixOS/nix/pull/709.
It allows you to snapshot all the sources of a nix derivation, not
just
one file.

I tested it back then, and it worked pretty well.

-- Layus.


On 06/04/17 17:46, ni...@vince.lol wrote:

No I don't have `system.copySystemConfiguration=true` set :-(
Luckily I documented my recent efforts in some gists.
I managed to install NixOS on ZFS here:
https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb94732
61459
And my (yet untested) attempt at PCI passthrough here:
https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b
87b26
There is still some missing, but nothing I can't handle, I guess.
This is a great time to enable my ZFS snapshots... :-/

Does anyone know why `system.copySystemConfiguration` is set to
false
by default? It seems like it would be better to default this to
true,
right?
Or at least have this listed in the generated config?
(`nixos-generate-config`)

Anyway, I'll be okay, thanks folks!!

Sincerely,
Vince
On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov
 wrote:

Hi Vince,

Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:

I acidentally removed my /etc/nixos/configuration.nix is there
any way
I can get it back?


Citing directly from:

  http://stackoverflow.com/questions/28603773/recover-accidentally
-deleted-configuration-nix-file


  '''
  system.copySystemConfiguration

  If enabled, copies the NixOS configuration file $NIXOS_CONFIG
(usually
  /etc/nixos/configuration.nix) to the system store path.

  Type:"boolean"

  Default:false

  Declared by:  
  '''

Do you happen to have this option set to true?

/me goes and sets it to true on his system

--
Sergiu



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread Vince
Benjamin Herr  schreef op 10 april 2017 19:17:44 CEST:
>I've been putting
>
>    environment.etc = {
>        nixos-orig.source = ./.;
>    };
>
>into my configuration.nix and for my still fairly trivial but at least
>somewhat moduralized config it seems to work out all right.
>
>
>On Thu, 2017-04-06 at 18:12 +0200, Guillaume Maudoux (Layus) wrote:
>> Hi,
>> 
>> system.copySystemConfiguration is far from perfect. As soon as you 
>> modularize your config, you will miss all the other files.
>> 
>> If you want a correct system.copySystemConfiguration, you really
>> need 
>> https://github.com/NixOS/nix/pull/709.
>> It allows you to snapshot all the sources of a nix derivation, not
>> just 
>> one file.
>> 
>> I tested it back then, and it worked pretty well.
>> 
>> -- Layus.
>> 
>> 
>> On 06/04/17 17:46, ni...@vince.lol wrote:
>> > No I don't have `system.copySystemConfiguration=true` set :-(
>> > Luckily I documented my recent efforts in some gists.
>> > I managed to install NixOS on ZFS here: 
>> > https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb94732
>> > 61459
>> > And my (yet untested) attempt at PCI passthrough here: 
>> > https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b
>> > 87b26
>> > There is still some missing, but nothing I can't handle, I guess.
>> > This is a great time to enable my ZFS snapshots... :-/
>> > 
>> > Does anyone know why `system.copySystemConfiguration` is set to
>> > false 
>> > by default? It seems like it would be better to default this to
>> > true, 
>> > right?
>> > Or at least have this listed in the generated config? 
>> > (`nixos-generate-config`)
>> > 
>> > Anyway, I'll be okay, thanks folks!!
>> > 
>> > Sincerely,
>> > Vince
>> > On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov 
>> >  wrote:
>> > > 
>> > > Hi Vince,
>> > > 
>> > > Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
>> > > > 
>> > > > I acidentally removed my /etc/nixos/configuration.nix is there
>> > > > any way
>> > > > I can get it back?
>> > > 
>> > > 
>> > > Citing directly from:
>> > > 
>> > >  http://stackoverflow.com/questions/28603773/recover-accidentally
>> > > -deleted-configuration-nix-file 
>> > > 
>> > > 
>> > >  '''
>> > >  system.copySystemConfiguration
>> > > 
>> > >  If enabled, copies the NixOS configuration file $NIXOS_CONFIG
>> > > (usually
>> > >  /etc/nixos/configuration.nix) to the system store path.
>> > > 
>> > >  Type:"boolean"
>> > > 
>> > >  Default:false
>> > > 
>> > >  Declared by:  > > > level.nix>
>> > >  '''
>> > > 
>> > > Do you happen to have this option set to true?
>> > > 
>> > > /me goes and sets it to true on his system
>> > > 
>> > > -- 
>> > > Sergiu
>> > 
>> > 
>> > 
>> > ___
>> > nix-dev mailing list
>> > nix-dev@lists.science.uu.nl
>> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
>> 
>> 
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>> 


What does that do, exactly? The entry at 
http://nixos.org/nixos/options.html#environment.etc.%3Cname?%3E.source is 
somewhat lacking...

I made a PR at https://github.com/NixOS/nixpkgs/pull/24707 . If some of you 
could check it out and give me some feedback that’d be great :-)

cheers,
Vince___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread Benjamin Herr
I've been putting

    environment.etc = {
        nixos-orig.source = ./.;
    };

into my configuration.nix and for my still fairly trivial but at least
somewhat moduralized config it seems to work out all right.


On Thu, 2017-04-06 at 18:12 +0200, Guillaume Maudoux (Layus) wrote:
> Hi,
> 
> system.copySystemConfiguration is far from perfect. As soon as you 
> modularize your config, you will miss all the other files.
> 
> If you want a correct system.copySystemConfiguration, you really
> need 
> https://github.com/NixOS/nix/pull/709.
> It allows you to snapshot all the sources of a nix derivation, not
> just 
> one file.
> 
> I tested it back then, and it worked pretty well.
> 
> -- Layus.
> 
> 
> On 06/04/17 17:46, ni...@vince.lol wrote:
> > No I don't have `system.copySystemConfiguration=true` set :-(
> > Luckily I documented my recent efforts in some gists.
> > I managed to install NixOS on ZFS here: 
> > https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb94732
> > 61459
> > And my (yet untested) attempt at PCI passthrough here: 
> > https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b
> > 87b26
> > There is still some missing, but nothing I can't handle, I guess.
> > This is a great time to enable my ZFS snapshots... :-/
> > 
> > Does anyone know why `system.copySystemConfiguration` is set to
> > false 
> > by default? It seems like it would be better to default this to
> > true, 
> > right?
> > Or at least have this listed in the generated config? 
> > (`nixos-generate-config`)
> > 
> > Anyway, I'll be okay, thanks folks!!
> > 
> > Sincerely,
> > Vince
> > On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov 
> >  wrote:
> > > 
> > > Hi Vince,
> > > 
> > > Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
> > > > 
> > > > I acidentally removed my /etc/nixos/configuration.nix is there
> > > > any way
> > > > I can get it back?
> > > 
> > > 
> > > Citing directly from:
> > > 
> > >  http://stackoverflow.com/questions/28603773/recover-accidentally
> > > -deleted-configuration-nix-file 
> > > 
> > > 
> > >  '''
> > >  system.copySystemConfiguration
> > > 
> > >  If enabled, copies the NixOS configuration file $NIXOS_CONFIG
> > > (usually
> > >  /etc/nixos/configuration.nix) to the system store path.
> > > 
> > >  Type:"boolean"
> > > 
> > >  Default:false
> > > 
> > >  Declared by:   > > level.nix>
> > >  '''
> > > 
> > > Do you happen to have this option set to true?
> > > 
> > > /me goes and sets it to true on his system
> > > 
> > > -- 
> > > Sergiu
> > 
> > 
> > 
> > ___
> > nix-dev mailing list
> > nix-dev@lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 
> 
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-10 Thread zimbatm
This issue is likely to trip most newcomers. Maybe nixos-install should
create a git repo in /etc/nixos by default. And then "nixos build"
automatically commit on invocation.

On Mon, 10 Apr 2017, 04:41 Ryan Trinkle,  wrote:

> Jeaye,
>
> I totally agree!  One really interesting approach to this that I've seen
> is the 'pass' password manager, which can automatically handle the use of
> git for passwords.  I wonder if it would be feasible to do this for nixos
> as well, so that beginners (who might not be familiar with git) would
> automatically be doing "the right" (or at least "a reasonable") thing
> without needing to learn about it.
>
>
> Ryan
>
> On Sun, Apr 9, 2017 at 11:10 PM, Jeaye  wrote:
>
> On Thu, Apr 06, 2017 at 04:12:03PM +0200, ni...@vince.lol wrote:
> > Hi all,
> >
> > I acidentally removed my /etc/nixos/configuration.nix is there any way I
> can
> > get it back?
> >
> > Sincerely,
> > Vince
>
> I know you've sorted this out now, but I think it's worthwhile to mention
> that one of the benefits of having a text-based, declarative configuration
> for your OS is that you can very easily track it in git. NixOS will handle
> reverts for you, on an OS level, and git can handle them for you on a
> configuration level.
>
> If you don't want to host the configurations publicly, on Github or
> similar, you could do so privately, on Bitbucket or similar.
>
> Best of luck.
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-09 Thread Ryan Trinkle
Jeaye,

I totally agree!  One really interesting approach to this that I've seen is
the 'pass' password manager, which can automatically handle the use of git
for passwords.  I wonder if it would be feasible to do this for nixos as
well, so that beginners (who might not be familiar with git) would
automatically be doing "the right" (or at least "a reasonable") thing
without needing to learn about it.


Ryan

On Sun, Apr 9, 2017 at 11:10 PM, Jeaye  wrote:

> On Thu, Apr 06, 2017 at 04:12:03PM +0200, ni...@vince.lol wrote:
> > Hi all,
> >
> > I acidentally removed my /etc/nixos/configuration.nix is there any way I
> can
> > get it back?
> >
> > Sincerely,
> > Vince
>
> I know you've sorted this out now, but I think it's worthwhile to mention
> that one of the benefits of having a text-based, declarative configuration
> for your OS is that you can very easily track it in git. NixOS will handle
> reverts for you, on an OS level, and git can handle them for you on a
> configuration level.
>
> If you don't want to host the configurations publicly, on Github or
> similar, you could do so privately, on Bitbucket or similar.
>
> Best of luck.
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-09 Thread Jeaye
On Thu, Apr 06, 2017 at 04:12:03PM +0200, ni...@vince.lol wrote:
> Hi all,
> 
> I acidentally removed my /etc/nixos/configuration.nix is there any way I can
> get it back?
> 
> Sincerely,
> Vince

I know you've sorted this out now, but I think it's worthwhile to mention that 
one of the benefits of having a text-based, declarative configuration for your 
OS is that you can very easily track it in git. NixOS will handle reverts for 
you, on an OS level, and git can handle them for you on a configuration level.

If you don't want to host the configurations publicly, on Github or similar, 
you could do so privately, on Bitbucket or similar.

Best of luck.


signature.asc
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-09 Thread Layus
Yes, it's a fantastic idea that, like too many others, has a working 
implementation bitrotting in a PR.


But I have an idea to end this ;-). Coming soon :-D.

G.

On 06/04/17 20:54, Ryan Trinkle wrote:

Layus,

That does sound fantastic!  Do you think that PR has a reasonable 
chance of landing in the near future?



Ryan

On Thu, Apr 6, 2017 at 12:12 PM, Guillaume Maudoux (Layus) 
> wrote:


Hi,

system.copySystemConfiguration is far from perfect. As soon as you
modularize your config, you will miss all the other files.

If you want a correct system.copySystemConfiguration, you really
need https://github.com/NixOS/nix/pull/709
.
It allows you to snapshot all the sources of a nix derivation, not
just one file.

I tested it back then, and it worked pretty well.

-- Layus.


On 06/04/17 17:46, ni...@vince.lol  wrote:

No I don't have `system.copySystemConfiguration=true` set :-(
Luckily I documented my recent efforts in some gists.
I managed to install NixOS on ZFS here:
https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb9473261459


And my (yet untested) attempt at PCI passthrough here:
https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b87b26


There is still some missing, but nothing I can't handle, I guess.
This is a great time to enable my ZFS snapshots... :-/

Does anyone know why `system.copySystemConfiguration` is set to
false by default? It seems like it would be better to default
this to true, right?
Or at least have this listed in the generated config?
(`nixos-generate-config`)

Anyway, I'll be okay, thanks folks!!

Sincerely,
Vince
On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov
  wrote:


Hi Vince,

Thus quoth ni...@vince.lol   at 14:12 on
Thu, Apr 06 2017:


I acidentally removed my /etc/nixos/configuration.nix is there
any way
I can get it back?


Citing directly from:


http://stackoverflow.com/questions/28603773/recover-accidentally-deleted-configuration-nix-file




 '''
 system.copySystemConfiguration

 If enabled, copies the NixOS configuration file $NIXOS_CONFIG
(usually
 /etc/nixos/configuration.nix) to the system store path.

 Type:"boolean"

 Default:false

 Declared by:
 
 '''

Do you happen to have this option set to true?

/me goes and sets it to true on his system

-- 
Sergiu



___
nix-dev mailing list
nix-dev@lists.science.uu.nl 
http://lists.science.uu.nl/mailman/listinfo/nix-dev


___ nix-dev mailing
list nix-dev@lists.science.uu.nl

http://lists.science.uu.nl/mailman/listinfo/nix-dev
 

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Ryan Trinkle
Layus,

That does sound fantastic!  Do you think that PR has a reasonable chance of
landing in the near future?


Ryan

On Thu, Apr 6, 2017 at 12:12 PM, Guillaume Maudoux (Layus) <
layus...@gmail.com> wrote:

> Hi,
>
> system.copySystemConfiguration is far from perfect. As soon as you
> modularize your config, you will miss all the other files.
>
> If you want a correct system.copySystemConfiguration, you really need
> https://github.com/NixOS/nix/pull/709.
> It allows you to snapshot all the sources of a nix derivation, not just
> one file.
>
> I tested it back then, and it worked pretty well.
>
> -- Layus.
>
> On 06/04/17 17:46, ni...@vince.lol wrote:
>
> No I don't have `system.copySystemConfiguration=true` set :-(
> Luckily I documented my recent efforts in some gists.
> I managed to install NixOS on ZFS here: https://gist.github.com/
> awesomefireduck/c763e168a62a0ef559a1fb9473261459
> And my (yet untested) attempt at PCI passthrough here:
> https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b87b26
> There is still some missing, but nothing I can't handle, I guess.
> This is a great time to enable my ZFS snapshots... :-/
>
> Does anyone know why `system.copySystemConfiguration` is set to false by
> default? It seems like it would be better to default this to true, right?
> Or at least have this listed in the generated config?
> (`nixos-generate-config`)
>
> Anyway, I'll be okay, thanks folks!!
>
> Sincerely,
> Vince
>
> On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov 
>  wrote:
>
>
>
> Hi Vince,
>
> Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
>
>
> I acidentally removed my /etc/nixos/configuration.nix is there any way
> I can get it back?
>
>
> Citing directly from:
>
>  http://stackoverflow.com/questions/28603773/recover-accidentally-deleted-
> configuration-nix-file
>
>  '''
>  system.copySystemConfiguration
>
>  If enabled, copies the NixOS configuration file $NIXOS_CONFIG (usually
>  /etc/nixos/configuration.nix) to the system store path.
>
>  Type:"boolean"
>
>  Default:false
>
>  Declared by:  
>  '''
>
> Do you happen to have this option set to true?
>
>
> /me goes and sets it to true on his system
>
> --
> Sergiu
>
>
>
> ___
> nix-dev mailing 
> listnix-...@lists.science.uu.nlhttp://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Guillaume Maudoux (Layus)

Hi,

system.copySystemConfiguration is far from perfect. As soon as you 
modularize your config, you will miss all the other files.


If you want a correct system.copySystemConfiguration, you really need 
https://github.com/NixOS/nix/pull/709.
It allows you to snapshot all the sources of a nix derivation, not just 
one file.


I tested it back then, and it worked pretty well.

-- Layus.


On 06/04/17 17:46, ni...@vince.lol wrote:

No I don't have `system.copySystemConfiguration=true` set :-(
Luckily I documented my recent efforts in some gists.
I managed to install NixOS on ZFS here: 
https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb9473261459
And my (yet untested) attempt at PCI passthrough here: 
https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b87b26

There is still some missing, but nothing I can't handle, I guess.
This is a great time to enable my ZFS snapshots... :-/

Does anyone know why `system.copySystemConfiguration` is set to false 
by default? It seems like it would be better to default this to true, 
right?
Or at least have this listed in the generated config? 
(`nixos-generate-config`)


Anyway, I'll be okay, thanks folks!!

Sincerely,
Vince
On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov 
 wrote:


Hi Vince,

Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:


I acidentally removed my /etc/nixos/configuration.nix is there any way
I can get it back?


Citing directly from:

 http://stackoverflow.com/questions/28603773/recover-accidentally-deleted-configuration-nix-file 



 '''
 system.copySystemConfiguration

 If enabled, copies the NixOS configuration file $NIXOS_CONFIG (usually
 /etc/nixos/configuration.nix) to the system store path.

 Type:"boolean"

 Default:false

 Declared by:  
 '''

Do you happen to have this option set to true?

/me goes and sets it to true on his system

--
Sergiu



___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Alexey Shmalko
ni...@vince.lol writes:

> Hi all, 
>
> I acidentally removed my /etc/nixos/configuration.nix is there any way I can 
> get it back? 

If you have enabled system.copySystemConfiguration option, you can find
your config at /var/run/current-system/configuration.nix

Though, the option is disabled by default, so it's unlikely that will help
you this time :(

Also, it only copies the main configuration file and not any included
files.

Regards,
Alexey


signature.asc
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Ryan Trinkle
Hi Vince,

I do happen to know why it's set to false by default!  I sent a PR to
change it to true a while back, and got some good explanations for why
that's a bad idea here: https://github.com/NixOS/nixpkgs/pull/16922

However, I'm now wondering if it might make sense to add
"system.copySystemConfiguration" to nixos-generate-config's default output;
I added a comment to that PR explaining the idea.


Best,
Ryan

On Thu, Apr 6, 2017 at 11:46 AM,  wrote:

> No I don't have `system.copySystemConfiguration=true` set :-(
> Luckily I documented my recent efforts in some gists.
> I managed to install NixOS on ZFS here: https://gist.github.com/
> awesomefireduck/c763e168a62a0ef559a1fb9473261459
> And my (yet untested) attempt at PCI passthrough here:
> https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b87b26
> There is still some missing, but nothing I can't handle, I guess.
> This is a great time to enable my ZFS snapshots... :-/
>
> Does anyone know why `system.copySystemConfiguration` is set to false by
> default? It seems like it would be better to default this to true, right?
> Or at least have this listed in the generated config?
> (`nixos-generate-config`)
>
> Anyway, I'll be okay, thanks folks!!
>
> Sincerely,
> Vince
>
> On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov 
> wrote:
>
>
>
> Hi Vince,
>
> Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
>
>
> I acidentally removed my /etc/nixos/configuration.nix is there any way
> I can get it back?
>
>
> Citing directly from:
>
>  http://stackoverflow.com/questions/28603773/recover-accidentally-deleted-
> configuration-nix-file
>
>  '''
>  system.copySystemConfiguration
>
>  If enabled, copies the NixOS configuration file $NIXOS_CONFIG (usually
>  /etc/nixos/configuration.nix) to the system store path.
>
>  Type:"boolean"
>
>  Default:false
>
>  Declared by:  
>  '''
>
> Do you happen to have this option set to true?
>
>
> /me goes and sets it to true on his system
>
> --
> Sergiu
>
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Sergiu Ivanov

Thus quoth  ni...@vince.lol  at 15:46 on Thu, Apr 06 2017:
>
> Does anyone know why `system.copySystemConfiguration` is set to false
> by default? It seems like it would be better to default this to true,
> right?

I had the same question floating around my brain.

> Anyway, I'll be okay, thanks folks!!

Great news!

--
Sergiu


signature.asc
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread nixos

No I don't have `system.copySystemConfiguration=true` set :-(
Luckily I documented my recent efforts in some gists.
I managed to install NixOS on ZFS here: 
https://gist.github.com/awesomefireduck/c763e168a62a0ef559a1fb9473261459
And my (yet untested) attempt at PCI passthrough here: 
https://gist.github.com/awesomefireduck/1be07805081a4d7a51c527e452b87b26

There is still some missing, but nothing I can't handle, I guess.
This is a great time to enable my ZFS snapshots... :-/

Does anyone know why `system.copySystemConfiguration` is set to false 
by default? It seems like it would be better to default this to true, 
right?
Or at least have this listed in the generated config? 
(`nixos-generate-config`)


Anyway, I'll be okay, thanks folks!!

Sincerely,
Vince
 
On Thursday, April 6, 2017 4:58 PM, Sergiu Ivanov  
wrote:

 

Hi Vince,

Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
I acidentally removed my /etc/nixos/configuration.nix is there any 
way

I can get it back?

Citing directly from:

 
http://stackoverflow.com/questions/28603773/recover-accidentally-deleted-configuration-nix-file

 '''
 system.copySystemConfiguration

 If enabled, copies the NixOS configuration file $NIXOS_CONFIG 
(usually

 /etc/nixos/configuration.nix) to the system store path.

 Type:"boolean"

 Default:false

 Declared by: 
 

 '''

Do you happen to have this option set to true?
/me goes and sets it to true on his system

--
Sergiu
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Sergiu Ivanov

Hi Vince,

Thus quoth  ni...@vince.lol  at 14:12 on Thu, Apr 06 2017:
>
> I acidentally removed my /etc/nixos/configuration.nix is there any way
> I can get it back?

Citing directly from:

  
http://stackoverflow.com/questions/28603773/recover-accidentally-deleted-configuration-nix-file

  '''
  system.copySystemConfiguration

  If enabled, copies the NixOS configuration file $NIXOS_CONFIG (usually
  /etc/nixos/configuration.nix) to the system store path.

  Type:"boolean"

  Default:false

  Declared by:  
  '''

Do you happen to have this option set to true?


/me goes and sets it to true on his system

--
Sergiu


signature.asc
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread Tomasz Czyż
As it's read by nix, I assume it would be somewhere in nix store, but I did
quick look and didn't find (but might be there, nexted somewhere)

2017-04-06 15:12 GMT+01:00 :

> Hi all,
>
> I acidentally removed my /etc/nixos/configuration.nix is there any way I
> can get it back?
>
> Sincerely,
> Vince
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>


-- 
Tomasz Czyż
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] [Help] Accidentally removed configuration.nix

2017-04-06 Thread nixos

Hi all,

I acidentally removed my /etc/nixos/configuration.nix is there any way 
I can get it back?


Sincerely,
Vince
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev