Update to (somewhat?) dendritic pattern
Heavily inspired by https://github.com/Doc-Steve/dendritic-design-with-flake-parts. > Atomic commits? Never heard of them!
This commit is contained in:
22
modules/factory/autologin.nix
Normal file
22
modules/factory/autologin.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ inputs, ... }: {
|
||||
config.flake.factory.autologin = username: {
|
||||
imports = with inputs.self.modules.nixos; [
|
||||
];
|
||||
services.getty.autologinUser = username;
|
||||
|
||||
home-manager.sharedModules = [
|
||||
inputs.self.modules.homeManager.autologin
|
||||
];
|
||||
};
|
||||
|
||||
config.flake.modules.homeManager.autologin = {
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
];
|
||||
|
||||
programs.zsh.profileExtra = ''
|
||||
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
|
||||
exec hyprland
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
6
modules/factory/flake-option.nix
Normal file
6
modules/factory/flake-option.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ lib, ... }: {
|
||||
options.flake.factory = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.unspecified;
|
||||
default = { };
|
||||
};
|
||||
}
|
||||
9
modules/factory/grub-boot.nix
Normal file
9
modules/factory/grub-boot.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
config.flake.factory.grub-boot = device: {
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
inherit device;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
};
|
||||
}
|
||||
19
modules/factory/hyprpaper.nix
Normal file
19
modules/factory/hyprpaper.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
config.flake.factory.hyprpaper =
|
||||
{ wallpaper_path
|
||||
, monitor_names
|
||||
,
|
||||
}: { config, ... }: {
|
||||
services.hyprpaper =
|
||||
/*
|
||||
TODO: assert that hyprland is enabled
|
||||
*/
|
||||
{
|
||||
enable = true;
|
||||
settings = {
|
||||
preload = [ wallpaper_path ];
|
||||
wallpaper = map (mon: "mon,${wallpaper_path}") monitor_names;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
36
modules/factory/mount-cifs.nix
Normal file
36
modules/factory/mount-cifs.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
config.flake.factory.mount-cifs =
|
||||
{ host
|
||||
, resource
|
||||
, destination
|
||||
, credentials_path
|
||||
, UID
|
||||
, GID
|
||||
,
|
||||
}: {
|
||||
fileSystems."${destination}" = {
|
||||
device = "//${host}/${resource}";
|
||||
fsType = "cifs";
|
||||
options = [
|
||||
# automount
|
||||
"x-systemd.automount"
|
||||
"noauto"
|
||||
"nofail"
|
||||
"soft"
|
||||
"x-systemd.idle-timeout=60"
|
||||
"x-systemd.device-timeout=5s"
|
||||
"x-systemd.mount-timeout=5s"
|
||||
|
||||
# mount options
|
||||
"rw"
|
||||
"iocharset=utf8"
|
||||
|
||||
# user
|
||||
"uid=${UID}"
|
||||
"gid=${GID}"
|
||||
|
||||
"credentials=${credentials_path}"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
30
modules/factory/user.nix
Normal file
30
modules/factory/user.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ self, ... }: {
|
||||
config.flake.factory.user = username: isAdmin: {
|
||||
nixos."${username}" =
|
||||
{ lib
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
users.users."${username}" = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${username}";
|
||||
extraGroups = lib.optionals isAdmin [ "wheel" ];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
# required for zsh completion
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
|
||||
home-manager.users."${username}" = {
|
||||
imports = [
|
||||
self.modules.homeManager."${username}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
homeManager."${username}" = {
|
||||
home.username = "${username}";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user