Compare commits

...

3 Commits

Author SHA1 Message Date
ceee1b418c
minor cleanup 2024-04-21 12:29:05 -04:00
3a2a4e42df
hyprland: add "maximize" shortcut (fullscreen, 1) 2024-04-21 12:28:31 -04:00
1379670cd9
Add nix configuration for home-manager
This ensures home-manager devices use the the already downloaded nixpkgs
for ad-hoc commands like nix-shell and comma, as well as adds this flake
to the registry (currently assumed to be located at ~/nixfiles, I should
make this configurable later)
2024-04-21 12:24:48 -04:00
5 changed files with 49 additions and 1 deletions

View File

@ -3,5 +3,6 @@
imports = [
./wm.nix
./nodm.nix
./nix.nix
];
}

45
home/common/nix.nix Normal file
View File

@ -0,0 +1,45 @@
{ pkgs, lib, config, osConfig ? { }, options, nixpkgs, ... }:
let
cfg = config.nixfiles.common.nix;
standalone = !(osConfig ? home-manager);
in {
config = lib.mkIf cfg.enable (lib.mkMerge [
{
nix.registry = {
nixfiles = {
exact = true;
from = {
id = "nixfiles";
type = "indirect";
};
to = {
type = "git";
url = "file://${config.home.homeDirectory}/nixfiles";
};
};
};
}
(lib.mkIf standalone {
home.sessionVariables.NIX_PATH = "nixpkgs=${nixpkgs}\${NIX_PATH:+:\${NIX_PATH}}";
nix.registry = {
nixpkgs = {
exact = true;
from = {
id = "nixpkgs";
type = "indirect";
};
to = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
rev = "${nixpkgs.rev}";
};
};
};
})
]);
options.nixfiles.common.nix = {
enable = lib.mkEnableOption "Nix configuration";
};
}

View File

@ -1,6 +1,6 @@
{ pkgs, config, lib, options, osConfig ? { }, nixpkgs, home-manager, inputs, ... }@args:
let
isStandalone = with builtins; !( (typeOf osConfig == "set") && hasAttr "home-manager" osConfig );
isStandalone = osConfig ? home-manager;
cfg = config.nixfiles;
flakeType = cfg.lib.types.flake;
in

View File

@ -15,6 +15,7 @@ in
config = lib.mkIf cfg.enable {
nixfiles.programs.comma.enable = true;
nixfiles.common.nix.enable = true;
home.sessionVariables = lib.mkMerge [
(lib.mkIf config.programs.neovim.enable {

View File

@ -238,6 +238,7 @@ in
"$mod, f, fullscreen"
"$mod SHIFT, f, fakefullscreen"
"$mod CTRL, f, fullscreen, 1"
# Move focus with mod + arrow keys
"$mod, left, movefocus, l"