clean up and refactor more into OS snippets; bluetooth works on x13s
This commit is contained in:
parent
5921ad1df0
commit
ffdf25c117
27 changed files with 367 additions and 461 deletions
9
nix/os/snippets/bluetooth.nix
Normal file
9
nix/os/snippets/bluetooth.nix
Normal 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;
|
||||
}
|
49
nix/os/snippets/home-manager-with-zsh.nix
Normal file
49
nix/os/snippets/home-manager-with-zsh.nix
Normal 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" ];
|
||||
}
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue