flake: add own fork of hjem/hjem-rum

This commit is contained in:
Anthony Rodriguez 2025-02-22 00:39:32 +01:00
parent 4abdc5e278
commit 4e4a2d86e5
Signed by: nezia
SSH key fingerprint: SHA256:Ihfpl0rUpqDevYqnzSR34OYfVLbDNkBiUjs3CpX4ykA
3 changed files with 20 additions and 74 deletions

28
flake.lock generated
View file

@ -269,15 +269,16 @@
]
},
"locked": {
"lastModified": 1737619027,
"narHash": "sha256-jEzZs9dHdmVP5X9HCC/7jrv08aWFfqZV5cZ+cZWYGA4=",
"owner": "feel-co",
"lastModified": 1740156578,
"narHash": "sha256-qdDMmhzHCzM0NLhC/oC6pnapeys2H9dhQJbfwCnf7Fw=",
"owner": "nezia1",
"repo": "hjem",
"rev": "48cfa21987672a31a358b7e4d582fc174556e633",
"rev": "5a659b1a7c404278095f7086a73493dd2afc19b9",
"type": "github"
},
"original": {
"owner": "feel-co",
"owner": "nezia1",
"ref": "implement-environment-variables",
"repo": "hjem",
"type": "github"
}
@ -290,15 +291,16 @@
]
},
"locked": {
"lastModified": 1739301619,
"narHash": "sha256-lUpzQdeTne3CfHfW6QlgNmIVvKq6jO1tWQOyuhgUDt4=",
"owner": "snugnug",
"lastModified": 1740181011,
"narHash": "sha256-GKEhv8VV5aRRxiE6YZxFij8L/6+EEZ/X8J4NWkDXaUc=",
"owner": "nezia1",
"repo": "hjem-rum",
"rev": "0537c6ad02f26c28ed70f286a418087d581df2e5",
"rev": "c3f0f85e00a7278fbff0f2d99337a6eb47375abd",
"type": "github"
},
"original": {
"owner": "snugnug",
"owner": "nezia1",
"ref": "add-hyprland",
"repo": "hjem-rum",
"type": "github"
}
@ -311,11 +313,11 @@
]
},
"locked": {
"lastModified": 1735415443,
"narHash": "sha256-t/OSIIGVflXP70kQieq72x+zhLVYfMejRopPgOZnV0s=",
"lastModified": 1739891453,
"narHash": "sha256-dnJMqM3SVKSOOaRZOLDaRckFRHKInvwM9kqrOlS16VU=",
"owner": "feel-co",
"repo": "hjem",
"rev": "2979f66c4a1e6f662e4cb7fa9e20b9a6609919f9",
"rev": "f57c3210c08815cb141de3e49383a020d37ed36c",
"type": "github"
},
"original": {

View file

@ -113,12 +113,15 @@
url = "github:hyprwm/contrib";
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO: change to upstream once https://github.com/feel-co/hjem/pull/16 gets merged
hjem = {
url = "github:feel-co/hjem";
url = "github:nezia1/hjem/implement-environment-variables";
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO: change to upstream once https://github.com/snugnug/hjem-rum/pull/14 gets merged
hjem-rum = {
url = "github:snugnug/hjem-rum";
url = "github:nezia1/hjem-rum/add-hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
morewaita = {

View file

@ -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;
};
}