!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

881 Members
179 Servers

Load older messages


SenderMessageTime
20 Jul 2021
@blaggacao:matrix.orgDavid Arnold That's just an neglegtable (private) signal to another function of the flake-utils-plus library. 12:59:04
@blaggacao:matrix.orgDavid Arnold This other function automatically exporta overlays as packages, unless they are "upstream art" or have that flag set. 12:59:39
@blaggacao:matrix.orgDavid Arnold* This other function automatically exports overlays as packages, unless they are "upstream art" or have that flag set.12:59:57
@blaggacao:matrix.orgDavid Arnoldhttps://www.github.com/gytis-ivaskevicius/flake-utils-plus/tree/staging/lib%2FfromOverlays.nix#L7013:00:56
@ldesgoui:matrix.orgldesgoui joined the room.14:36:21
21 Jul 2021
@polykernel:kde.orgpolykernel
In reply to @balsoft:balsoft.ru
What do you mean by "type" of an input?
Sorry for the late reply, I meant other data types such as string, int just as flakes can have arbitrary outputs. However I realized this isn't in the scope of flakes and probably shouldn't be needed in the first place.
02:35:34
@polykernel:kde.orgpolykernel

If my understanding is correct, upon evaluating a flake, the directory where the flake resides is copied into the nix store. However when I attempt to reference a subdirectory of the flake directory within flake.nix itself, I can an error that the file does not exist even though it does.

<...>
users.users =
              builtins.listToAttrs (map
                (user: {
                  name = user;
                  value = {               
                    passwordFile = builtins.toString (./. + "/users/${user}/secrets/passwd");
                  };
                }) attr.users);
<...>

results in something like warning: password file ‘/nix/store/g76a07317yanvwp8lrib7zpji6flxpn1-source/users/user/secrets/passwd’ does not exist

02:46:26
@polykernel:kde.orgpolykernel *

If my understanding is correct, upon evaluating a flake, the directory where the flake resides is copied into the nix store. However when I attempt to reference a subdirectory of the flake directory within flake.nix itself, I get an error that the file does not exist even though it does.

<...>
users.users =
              builtins.listToAttrs (map
                (user: {
                  name = user;
                  value = {               
                    passwordFile = builtins.toString (./. + "/users/${user}/secrets/passwd");
                  };
                }) attr.users);
<...>

results in something like warning: password file ‘/nix/store/g76a07317yanvwp8lrib7zpji6flxpn1-source/users/user/secrets/passwd’ does not exist

02:46:43
@polykernel:kde.orgpolykernel *

If my understanding is correct, upon evaluating a flake, the directory where the flake resides is copied into the nix store. However when I attempt to reference a subdirectory of the flake directory within flake.nix itself, I get an error that the file does not exist even though it does.

<...>
users.users =
  builtins.listToAttrs (map
    (user: {
      name = user;
      value = {               
        passwordFile = builtins.toString (./. + "/users/${user}/secrets/passwd");
      };
    }) attr.users);
<...>

results in something like warning: password file ‘/nix/store/g76a07317yanvwp8lrib7zpji6flxpn1-source/users/user/secrets/passwd’ does not exist

02:47:40
@blaggacao:matrix.orgDavid Arnoldhttps://digga.divnix.com &mdash; I'd be very happy for any feedback on the freshly baked docs.05:01:37
@blaggacao:matrix.orgDavid Arnold * https://digga.divnix.com -- I'd be very happy for any feedback you could afford on the freshly baked docs.05:02:01
@blaggacao:matrix.orgDavid Arnold * https://digga.divnix.com -- I'd be very happy for any feedback you could afford on the freshly baked docs. (including proof reading)05:04:01
23 Jul 2021
Room Avatar Renderer.23:21:58
24 Jul 2021
@manveru:matrix.orgmanveru joined the room.16:10:07
25 Jul 2021
@khushraj:matrix.orgKhushraj Rathod joined the room.08:35:52
26 Jul 2021
@ambroisie:belanyi.frAmbroisie joined the room.13:16:01
27 Jul 2021
@joepie91:pixie.townjoepie91 🏳️‍🌈 joined the room.23:34:25
28 Jul 2021
@hexagonk:halogen.cityhexagonk joined the room.05:52:42
@elonsroadster:matrix.orgIvan Malison joined the room.06:35:10
@elonsroadster:matrix.orgIvan MalisonSo this issue is starting to really annoy me https://github.com/NixOS/nix/issues/4265 but I feel like part of the problem is that its actually not entirely clear what the right solution is Does anyone have any thoughts?06:46:50
29 Jul 2021
@papojari:artemislena.eupapojari 🏳️‍🌈 joined the room.16:58:25
@papojari:artemislena.eupapojari 🏳️‍🌈Redacted or Malformed Event18:42:34
@papojari:artemislena.eupapojari 🏳️‍🌈

Can you tell me why I get this

❯ sh /git-repos/nixos-config-desktop/apply-users.sh
/git-repos/nixos-config-desktop ~
warning: Git tree '/git-repos/nixos-config-desktop' is dirty
error: attribute 'currentSystem' missing

       at /nix/store/svybjwf9ab3iqiz8zwwqwbqzksl3gx8v-source/pkgs/top-level/impure.nix:18:43:

           17|   # (build, in GNU Autotools parlance) platform.
           18|   localSystem ? { system = args.system or builtins.currentSystem; }
             |                                           ^
           19|

This is what /git-repos/nixos-config-desktop/apply-users.sh does

#!/bin/sh
pushd /git-repos/nixos-config-desktop
nix build .#homeManagerConfigurations.papojari.activationPackage
./result/activate
popd

Here is the content of my flake

{
	description = "papojari's NixOS configuration";

	inputs = {
		nixpkgs.url = "nixpkgs/nixos-unstable";
		home-manager.url = "github:nix-community/home-manager/master";
		home-manager.inputs.nixpkgs.follows = "nixpkgs";
	};

	outputs = { nixpkgs, home-manager, ... }:
	let
		pkgs = import nixpkgs {
			config = {
				allowUnfree = true;
			};
		};
		lib = nixpkgs.lib;
	in {
		homeManagerConfigurations = {
			papojari = home-manager.lib.homeManagerConfiguration {
				system = "x86_64-linux";
				inherit pkgs;
				username = "papojari";
				homeDirectory = "/home/papojari";
				configuration = {
					imports = [
						./users/papojari/home.nix
					];
				};
			};
		};
		nixosConfigurations = {
			Cryogonal = lib.nixosSystem {
				system = "x86_64-linux";
				modules = [
					./system/configuration-amd.nix
				];
			};
			Cryogonull = lib.nixosSystem {
				system = "aarch64-linux";
				modules = [
					./system/configuration-rpi4.nix
				];
			};
		};
	};
}

you can also have a look at the the here

18:45:09
@papojari:artemislena.eupapojari 🏳️‍🌈 *

Can you tell me why I get this

❯ sh /git-repos/nixos-config-desktop/apply-users.sh
/git-repos/nixos-config-desktop ~
warning: Git tree '/git-repos/nixos-config-desktop' is dirty
error: attribute 'currentSystem' missing

       at /nix/store/svybjwf9ab3iqiz8zwwqwbqzksl3gx8v-source/pkgs/top-level/impure.nix:18:43:

           17|   # (build, in GNU Autotools parlance) platform.
           18|   localSystem ? { system = args.system or builtins.currentSystem; }
             |                                           ^
           19|

This is what /git-repos/nixos-config-desktop/apply-users.sh does

#!/bin/sh
pushd /git-repos/nixos-config-desktop
nix build .#homeManagerConfigurations.papojari.activationPackage
./result/activate
popd

Here is the content of my flake

{
	description = "papojari's NixOS configuration";

	inputs = {
		nixpkgs.url = "nixpkgs/nixos-unstable";
		home-manager.url = "github:nix-community/home-manager/master";
		home-manager.inputs.nixpkgs.follows = "nixpkgs";
	};

	outputs = { nixpkgs, home-manager, ... }:
	let
		pkgs = import nixpkgs {
			config = {
				allowUnfree = true;
			};
		};
		lib = nixpkgs.lib;
	in {
		homeManagerConfigurations = {
			papojari = home-manager.lib.homeManagerConfiguration {
				system = "x86_64-linux";
				inherit pkgs;
				username = "papojari";
				homeDirectory = "/home/papojari";
				configuration = {
					imports = [
						./users/papojari/home.nix
					];
				};
			};
		};
		nixosConfigurations = {
			Cryogonal = lib.nixosSystem {
				system = "x86_64-linux";
				modules = [
					./system/configuration-amd.nix
				];
			};
			Cryogonull = lib.nixosSystem {
				system = "aarch64-linux";
				modules = [
					./system/configuration-rpi4.nix
				];
			};
		};
	};
}

you can also have a look at the files here

18:46:58
@elonsroadster:matrix.orgIvan Malison@papojari You cant use current-system in flakes18:53:55
@papojari:artemislena.eupapojari 🏳️‍🌈
In reply to @elonsroadster:matrix.org
@papojari You cant use current-system in flakes
then how am I supposed to rebuild my home-manager configuration
18:55:34
@papojari:artemislena.eupapojari 🏳️‍🌈I followed Wil Taylor's tutorial on how to move your system into a flake?18:56:10
@papojari:artemislena.eupapojari 🏳️‍🌈 * I followed Wil Taylor's tutorial on how to move your system into a flake18:56:14
@elonsroadster:matrix.orgIvan MalisonI use home-manager with flakes without much issue18:56:18
@elonsroadster:matrix.orgIvan Malisonyou can do: imports = [ home-manager.nixosModule ];18:57:24

Show newer messages


Back to Room ListRoom Version: 6