flake: add own fork of hjem/hjem-rum
This commit is contained in:
parent
4abdc5e278
commit
4e4a2d86e5
3 changed files with 20 additions and 74 deletions
28
flake.lock
generated
28
flake.lock
generated
|
@ -269,15 +269,16 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737619027,
|
"lastModified": 1740156578,
|
||||||
"narHash": "sha256-jEzZs9dHdmVP5X9HCC/7jrv08aWFfqZV5cZ+cZWYGA4=",
|
"narHash": "sha256-qdDMmhzHCzM0NLhC/oC6pnapeys2H9dhQJbfwCnf7Fw=",
|
||||||
"owner": "feel-co",
|
"owner": "nezia1",
|
||||||
"repo": "hjem",
|
"repo": "hjem",
|
||||||
"rev": "48cfa21987672a31a358b7e4d582fc174556e633",
|
"rev": "5a659b1a7c404278095f7086a73493dd2afc19b9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "feel-co",
|
"owner": "nezia1",
|
||||||
|
"ref": "implement-environment-variables",
|
||||||
"repo": "hjem",
|
"repo": "hjem",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -290,15 +291,16 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739301619,
|
"lastModified": 1740181011,
|
||||||
"narHash": "sha256-lUpzQdeTne3CfHfW6QlgNmIVvKq6jO1tWQOyuhgUDt4=",
|
"narHash": "sha256-GKEhv8VV5aRRxiE6YZxFij8L/6+EEZ/X8J4NWkDXaUc=",
|
||||||
"owner": "snugnug",
|
"owner": "nezia1",
|
||||||
"repo": "hjem-rum",
|
"repo": "hjem-rum",
|
||||||
"rev": "0537c6ad02f26c28ed70f286a418087d581df2e5",
|
"rev": "c3f0f85e00a7278fbff0f2d99337a6eb47375abd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "snugnug",
|
"owner": "nezia1",
|
||||||
|
"ref": "add-hyprland",
|
||||||
"repo": "hjem-rum",
|
"repo": "hjem-rum",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -311,11 +313,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735415443,
|
"lastModified": 1739891453,
|
||||||
"narHash": "sha256-t/OSIIGVflXP70kQieq72x+zhLVYfMejRopPgOZnV0s=",
|
"narHash": "sha256-dnJMqM3SVKSOOaRZOLDaRckFRHKInvwM9kqrOlS16VU=",
|
||||||
"owner": "feel-co",
|
"owner": "feel-co",
|
||||||
"repo": "hjem",
|
"repo": "hjem",
|
||||||
"rev": "2979f66c4a1e6f662e4cb7fa9e20b9a6609919f9",
|
"rev": "f57c3210c08815cb141de3e49383a020d37ed36c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -113,12 +113,15 @@
|
||||||
url = "github:hyprwm/contrib";
|
url = "github:hyprwm/contrib";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
# TODO: change to upstream once https://github.com/feel-co/hjem/pull/16 gets merged
|
||||||
hjem = {
|
hjem = {
|
||||||
url = "github:feel-co/hjem";
|
url = "github:nezia1/hjem/implement-environment-variables";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO: change to upstream once https://github.com/snugnug/hjem-rum/pull/14 gets merged
|
||||||
hjem-rum = {
|
hjem-rum = {
|
||||||
url = "github:snugnug/hjem-rum";
|
url = "github:nezia1/hjem-rum/add-hyprland";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
morewaita = {
|
morewaita = {
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.options) mkOption;
|
|
||||||
inherit (lib.strings) concatStringsSep;
|
|
||||||
inherit (lib.types) attrsOf listOf oneOf int path str;
|
|
||||||
inherit (pkgs) writeShellScript;
|
|
||||||
|
|
||||||
cfg = config.environment;
|
|
||||||
|
|
||||||
toEnv = env:
|
|
||||||
if isList env
|
|
||||||
then concatStringsSep ":" (map toString env)
|
|
||||||
else toString env;
|
|
||||||
|
|
||||||
mkEnvVars = vars: (concatStringsSep "\n"
|
|
||||||
(mapAttrsToList (name: value: "export ${name}=\"${toEnv value}\"") vars));
|
|
||||||
|
|
||||||
writeEnvScript = attrs:
|
|
||||||
writeShellScript "set-environment"
|
|
||||||
(mkEnvVars attrs);
|
|
||||||
in {
|
|
||||||
options.environment = {
|
|
||||||
setEnvironment = mkOption {
|
|
||||||
type = path;
|
|
||||||
readOnly = true;
|
|
||||||
description = ''
|
|
||||||
A POSIX compliant shell script containing the user session variables needed to bootstrap the session.
|
|
||||||
|
|
||||||
As there is no reliable and agnostic way of setting session variables, Hjem's
|
|
||||||
environment module does nothing by itself. Rather, it provides a POSIX compliant shell script
|
|
||||||
that needs to be sourced where needed.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
sessionVariables = mkOption {
|
|
||||||
type = attrsOf (oneOf [(listOf (oneOf [int str path])) int str path]);
|
|
||||||
default = {};
|
|
||||||
example = {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
VISUAL = "nvim";
|
|
||||||
};
|
|
||||||
description = ''
|
|
||||||
A set of environment variables used in the user environment.
|
|
||||||
If a list of strings is used, they will be concatenated with colon
|
|
||||||
characters.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf (cfg.sessionVariables != {}) {
|
|
||||||
environment.setEnvironment = writeEnvScript cfg.sessionVariables;
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue