working towards selectable wm

This commit is contained in:
mehbark 2023-08-15 18:19:41 -04:00
parent aa246ebde3
commit 1e8a45546a
5 changed files with 67 additions and 18 deletions

View file

@ -1,8 +1,13 @@
{ wm ? null, ...}:
with builtins; with builtins;
{ rec {
wm = "plasma"; wm = wm;
x11-wms = ["plasma" "xmonad" "i3"];
wayland-wms = ["hyprland" "sway"];
wms = x11-wms ++ wayland-wms;
# very, very non-exhaustive of course # very, very non-exhaustive of course
is-x11 = wm: elem wm ["plasma" "xmonad" "i3"]; is-x11 = wm: elem wm x11-wms;
is-wayland = wm: elem wm ["hyprland" "sway"]; is-wayland = wm: elem wm wayland-wms;
} }

View file

@ -2,9 +2,10 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
build-conf:
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
conf = import ./build.conf.nix; conf = build-conf;
x11 = conf.is-x11 conf.wm; x11 = conf.is-x11 conf.wm;
in in
{ {

View file

@ -1,5 +1,23 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -7,11 +25,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1692081771, "lastModified": 1692131549,
"narHash": "sha256-LWhyDz3gi1RzTcW6e6iwfs4VuDWFajOexBKygNIqvQM=", "narHash": "sha256-MFjI8NL63/6HjMZpvJgnB/Pgg2dht22t45jOYtipZig=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "18791781ea86cbec6bce8bcb847444b9c73b8b3b", "rev": "75cfe974e2ca05a61b66768674032b4c079e55d4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,9 +56,25 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -4,21 +4,31 @@
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.home-manager.url = "github:nix-community/home-manager"; inputs.home-manager.url = "github:nix-community/home-manager";
inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = inputs@{ self, nixpkgs, home-manager, ... }: { outputs = inputs@{ self, nixpkgs, home-manager, flake-utils, ... }:
nixosConfigurations = { let
conf = (import ./build.conf.nix) {};
in
{
nixosConfigurations =
flake-utils.lib.eachSystem conf.wms (wm:
let
conf = import (./build.conf.nix) { wm = wm; };
in
{
nix = nixpkgs.lib.nixosSystem { nix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./configuration.nix (./configuration.nix conf)
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.mbk = import ./home.nix; home-manager.users.mbk = (import ./home.nix) conf;
} }
]; ];
}; };
}; });
}; };
} }

View file

@ -1,6 +1,7 @@
build-conf:
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
conf = import ./build.conf.nix; conf = build-conf;
wm = conf.wm; wm = conf.wm;
in in
{ {
@ -131,10 +132,8 @@ in
programs.git = { programs.git = {
enable = true; enable = true;
extraConfig = { userName = "mehbark";
userName = "mehbark"; userEmail = "terezi@pyrope.net";
userEmail = "terezi@pyrope.net";
};
}; };
programs.git.difftastic = { programs.git.difftastic = {