clean up and refactor more into OS snippets; bluetooth works on x13s

This commit is contained in:
steveej 2024-01-24 00:24:04 +00:00
parent 5921ad1df0
commit ffdf25c117
27 changed files with 367 additions and 461 deletions

View file

@ -0,0 +1,9 @@
{ pkgs
, lib
, ...
}: {
# required for running blueman-applet in user sessions
services.dbus.packages = with pkgs; [ blueman ];
hardware.bluetooth.enable = true;
services.blueman.enable = true;
}

View file

@ -0,0 +1,49 @@
{ nodeFlake
, repoFlake
, repoFlakeInputs'
, packages'
, pkgs
, ...
}:
let
# TODO: make this configurable
homeUser = "steveej";
commonHomeImports = [
../../home-manager/profiles/common.nix
../../home-manager/programs/neovim.nix
../../home-manager/programs/zsh.nix
];
in
{
imports = [
nodeFlake.inputs.home-manager.nixosModules.home-manager
];
# TODO: investigate an issue with the "name" arg contained here, which causes problems with home-manager
# home-manager.extraSpecialArgs = specialArgs;
# hence, opt for passing the arguments selectively instead
home-manager.extraSpecialArgs = {
inherit
repoFlake
repoFlakeInputs'
packages'
nodeFlake
;
};
home-manager.useGlobalPkgs = false;
home-manager.useUserPackages = true;
home-manager.users.root = _: {
imports = commonHomeImports;
};
home-manager.users."${homeUser}" = _: {
imports = commonHomeImports;
};
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
environment.pathsToLink = [ "/share/zsh" ];
}

View file

@ -1,9 +1,7 @@
{
nodeFlake,
pkgs,
lib,
...
{ nodeFlake
, pkgs
, lib
, ...
}: {
nix.daemonCPUSchedPolicy = "idle";
nix.daemonIOSchedClass = "idle";
@ -17,8 +15,6 @@
nix.settings.experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
"impure-derivations"
];
nix.settings.system-features = [
@ -29,4 +25,5 @@
];
nix.registry.nixpkgs.flake = nodeFlake.inputs.nixpkgs;
}

View file

@ -1,4 +1,8 @@
{ pkgs, lib, ... }:
{ pkgs
, lib
, config
, ...
}:
let
# TODO: make this configurable
@ -64,6 +68,7 @@ in
};
security.pam.services.getty.enableGnomeKeyring = true;
security.pam.services."autovt@tty1".enableGnomeKeyring = true;
services.gnome.gnome-keyring.enable = true;
# autologin steveej on tty1
@ -79,11 +84,20 @@ in
Restart = "always";
Type = "idle";
};
programs.zsh.loginShellInit = ''
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
exec sway
fi
'';
programs =
let
steveejSwayOnTty1 = ''
if test $(id --user steveej) = $(id -u) && test $(tty) = "/dev/tty1"; then
exec sway
fi
'';
in
{
bash.loginShellInit = steveejSwayOnTty1;
# TODO: only do this when zsh is enabled. first naiv attempt lead infinite recursion
zsh.loginShellInit = steveejSwayOnTty1;
};
home-manager.users."${homeUser}" = _: {
imports = [