!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

609 Members
121 Servers

Load older messages


SenderMessageTime
9 May 2024
@morgrimm:matrix.orgremi-gelinas joined the room.13:25:37
@crhamiltonj:matrix.orgCharles Hamilton joined the room.19:19:05
@aidalgol:matrix.org@aidalgol:matrix.org
In reply to @mfed3:matrix.org

Hey guys I have a question on autoupgrade, what does this actually do:

  system.autoUpgrade = {
    enable = true;
    allowReboot =  true;
    flake = inputs.self.outPath;
    flags = [ "--update-input" "nixpkgs" "--print-build-logs" ];
  };

Going by the description of system.autoUpgrade.flags, this will update the nixpkgs input to your system config flake.

If you are using flakes and use a local repo you can add [ "--update-input" "nixpkgs" "--commit-lock-file" ] to update nixpkgs.

20:40:24
@aidalgol:matrix.org@aidalgol:matrix.org You could also point system.autoUpgrade.flake to a remote flake (e.g. a git repo), and something else keeps that flake up to date, and the nixos-rebuild systemd job on your server will just apply the flake as-is. 20:42:16
@mfed3:matrix.orgmfed3It isn't very clear because I saw peoples usage on other websites saying they run it this way, and it will bump the lock file, meaning it blows past the lock file and changes the one on your local21:15:48
@mfed3:matrix.orgmfed3With the flag you mentioned it will not only blow past your lock file it will update and commit it21:16:35
@mfed3:matrix.orgmfed3So I guess to keep it in line with the flake you want no flags?21:17:32
@vzxplnhqr:matrix.orgvzxplnhqr joined the room.21:17:54
@vzxplnhqr:matrix.orgvzxplnhqr

Hi flake people. I am trying to follow the "make menuconfig" section of https://nixos.wiki/wiki/Linux_kernel but I do not know how to translate it to the world of flakes:

$ nix-shell -E 'with import <nixpkgs> {}; linux.overrideAttrs (o: {nativeBuildInputs=o.nativeBuildInputs ++ [ pkg-config ncurses ];})'
[nix-shell] $ unpackPhase && cd linux-*
[nix-shell] $ patchPhase
[nix-shell] $ make menuconfig
21:19:15
@vzxplnhqr:matrix.orgvzxplnhqr(because without figuring this out, I get errors pertaining to ncurses not existing in the build and so on)21:20:47
@mfed3:matrix.orgmfed3My use case is i want to decide when to bump the flag to a version i want and then push that out to my machines and they just check the flake file and update to that version overnight, not updating past that21:21:48
@aidalgol:matrix.org@aidalgol:matrix.orgSounds like you want no flags, then.21:30:14
@samasaur:matrix.orgsamasaurthat is correct, you want no flags22:45:56
@mfed3:matrix.orgmfed3Perfect thanks 23:46:49
10 May 2024
@isabel:isabelroses.com@isabel:isabelroses.com changed their profile picture.13:15:04
@esperlily:matrix.orgEsperLily [she/her] changed their profile picture.18:57:03
@ayyz12:matrix.org@ayyz12:matrix.org joined the room.22:40:11
11 May 2024
@mfed3:matrix.orgmfed3

I did a bit of refactoring of my system and i switched my config over to

  outputs = { self, nixpkgs, ... }@inputs: {
    
    nixosConfigurations = {
      host1 = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs; };
        system = "x86_64-linux";
        modules = [ ./hosts/host1 ];
      };

instead of

modules = [ ./hosts/host1/configuration.nix ] ;
01:53:04
@mfed3:matrix.orgmfed3

I renamed the file from configuration.nix to default.nix but when I try to build the flake it complains the file doesn't exist

   error: getting status of '/nix/store/mgakxblir0hipxmdd41xrspq7xzd4z1s-source/hosts/fed-gc/default.nix': No such file or directory

it's translating it properly from a folder to looking for default.nix why would it not think it's there?

01:54:20
@mfed3:matrix.orgmfed3 *

I renamed the file from configuration.nix to default.nix but when I try to build the flake it complains the file doesn't exist

   error: getting status of '/nix/store/mgakxblir0hipxmdd41xrspq7xzd4z1s-source/hosts/host1/default.nix': No such file or directory

it's translating it properly from a folder to looking for default.nix why would it not think it's there?

01:54:32
@mfed3:matrix.orgmfed3Ugh nevermind figured it out, this flakes thing is so weird it doesn't know files exist unless you stage them or commit them02:00:14
@mfed3:matrix.orgmfed3Can't just refactor whatever you want and expect it to pick up the files you changed02:00:48
@samasaur:matrix.orgsamasauryeah if your flake is a git repository then all files you want to use must be tracked by git03:10:59
@skiparoo:matrix.orgskippy changed their display name from skip to skippy.03:44:06
@abmantis:abcosta.com@abmantis:abcosta.com indeed, if I run nix-collect-garbage, nix develop will download stuff again, even with the --profile flag (and I've checked that the symlink is created) 22:33:51
@abmantis:abcosta.com@abmantis:abcosta.com
copying path '/nix/store/cbv4vws08zb992ncmm05z7ax0hzvcgxy-source' from 'https://cache.nixos.org'...
this path will be fetched (0.10 MiB download, 0.10 MiB unpacked):
  /nix/store/mr8v83npjv2na7w6q922dcjxxfyd58a0-bash-interactive-5.2p26-man
copying path '/nix/store/mr8v83npjv2na7w6q922dcjxxfyd58a0-bash-interactive-5.2p26-man' from 'https://cache.nixos.org'...

That is what it prints with --verbose

22:34:56
@abmantis:abcosta.com@abmantis:abcosta.comhttps://github.com/NixOS/nix/issues/425023:05:48
@abmantis:abcosta.com@abmantis:abcosta.commeh, bug :(23:05:51
12 May 2024
@verlannow:matrix.org@verlannow:matrix.org joined the room.07:22:03
13 May 2024
@conr:mozilla.org@conr:mozilla.org joined the room.01:51:07

Show newer messages


Back to Room ListRoom Version: 6