!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

859 Members
177 Servers

Load older messages


SenderMessageTime
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.orgelonsroadster joined the room.06:35:10
@elonsroadster:matrix.orgelonsroadsterSo 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.eupapojariRedacted 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.orgelonsroadster@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.eupapojariI 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.orgelonsroadsterI use home-manager with flakes without much issue18:56:18
@elonsroadster:matrix.orgelonsroadsteryou can do: imports = [ home-manager.nixosModule ];18:57:24
@ambroisie:belanyi.frAmbroisie left the room.19:00:38
@papojari:artemislena.eupapojari
In reply to @elonsroadster:matrix.org
you can do: imports = [
home-manager.nixosModule
];
where am I supposed to put this
19:00:59
30 Jul 2021
@polykernel:kde.orgpolykernel

are let statements not allowed at the toplevel for flakes, for instance

let
# etc
in
{
02:25:37
@polykernel:kde.orgpolykernel *

are let statements not allowed at the toplevel for flakes, for instance

let
# etc
in
{
  # etc
}
02:25:48
@polykernel:kde.orgpolykernel *

are let statements not allowed at the toplevel for flakes, for instance

let
  # etc
in
{
  # etc
}
02:25:59
@polykernel:kde.orgpolykernel *

are let statements not allowed at the toplevel for flakes, for instance

let
  # etc
in
{
  inputs = {
     # etc
  };

  outputs = { self, ... }: {
     # etc
  };
}
02:35:30
@tomberek:matrix.orgtomberek polykernel: no, the top-level of flakes are restricted, as are some other constructs that would cause them to be more difficult to evaluate/cache 02:55:40
@tomberek:matrix.orgtomberek * polykernel: no, the top-level of flakes are restricted, as are some other constructs that would cause them to be more difficult to evaluate/cache (Refer: https://github.com/NixOS/nix/issues/3966#issuecomment-682497697 ) 03:04:10
@polykernel:kde.orgpolykernel thanks, I should of known this. I recall reading that computation is forbidden on metadata attributes(https://github.com/NixOS/nix/issues/4945#issuecomment-868572873), but it didn't occur to me at least somehow, it included the top level as well. 03:12:27
@polykernel:kde.orgpolykernel * thanks, I should of known this. I recall reading that computation is forbidden for metadata attributes(https://github.com/NixOS/nix/issues/4945#issuecomment-868572873), but it didn't occur to me at least somehow, it included the top level as well.03:12:38
@polykernel:kde.orgpolykernel * thanks, I should of known this. I recall reading that computation is forbidden for metadata attributes(https://github.com/NixOS/nix/issues/4945#issuecomment-868572873), but it somehow didn't occur to me it included the top level as well.03:12:55
@polykernel:kde.orgpolykernelso due to the evaluation constraint of flakes, if I want to do computation for inputs (i.e, dynamically generate inputs),I would have to write a generator for flake.nix using another nix expression?03:17:10

Show newer messages


Back to Room ListRoom Version: 6