forked from mirrors_public/oddlama_nix-config
feat: add lidswitch and some modules
This commit is contained in:
parent
4b4268b537
commit
4db499a5d3
12 changed files with 222 additions and 47 deletions
|
@ -16,7 +16,7 @@
|
||||||
../../modules/laptop.nix
|
../../modules/laptop.nix
|
||||||
../../modules/yubikey.nix
|
../../modules/yubikey.nix
|
||||||
../../modules/zfs.nix
|
../../modules/zfs.nix
|
||||||
../../users/oddlama
|
../../users/myuser
|
||||||
|
|
||||||
./fs.nix
|
./fs.nix
|
||||||
./net.nix
|
./net.nix
|
||||||
|
|
26
modules/bluetooth.nix
Normal file
26
modules/bluetooth.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
environment.systemPackages = with pkgs; [bluetuith];
|
||||||
|
|
||||||
|
hardware.bluetooth = {
|
||||||
|
enable = true;
|
||||||
|
powerOnBoot = true;
|
||||||
|
disabledPlugins = ["sap"];
|
||||||
|
settings = {
|
||||||
|
General = {
|
||||||
|
FastConnectable = "true";
|
||||||
|
JustWorksRepairing = "always";
|
||||||
|
MultiProfile = "multiple";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
package = pkgs.pulseaudio.override {bluetoothSupport = true;};
|
||||||
|
extraConfig = ''
|
||||||
|
load-module module-bluetooth-discover
|
||||||
|
load-module module-bluetooth-policy
|
||||||
|
load-module module-switch-on-connect
|
||||||
|
'';
|
||||||
|
extraModules = with pkgs; [pulseaudio-modules-bt];
|
||||||
|
};
|
||||||
|
}
|
11
modules/efi.nix
Normal file
11
modules/efi.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
boot.loader = {
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
configurationLimit = 15;
|
||||||
|
};
|
||||||
|
timeout = lib.mkDefault 2;
|
||||||
|
};
|
||||||
|
console.earlySetup = true;
|
||||||
|
}
|
15
modules/laptop.nix
Normal file
15
modules/laptop.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
services.logind = {
|
||||||
|
lidSwitch = "ignore";
|
||||||
|
lidSwitchDocked = "ignore";
|
||||||
|
lidSwitchExternalPower = "ignore";
|
||||||
|
extraConfig = ''
|
||||||
|
HandlePowerKey=suspend
|
||||||
|
HandleSuspendKey=suspend
|
||||||
|
HandleHibernateKey=suspend
|
||||||
|
PowerKeyIgnoreInhibited=yes
|
||||||
|
SuspendKeyIgnoreInhibited=yes
|
||||||
|
HibernateKeyIgnoreInhibited=yes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
19
modules/nvidia.nix
Normal file
19
modules/nvidia.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
boot.blacklistedKernelModules = ["nouveau"];
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
nvidiaPersistenced = true;
|
||||||
|
};
|
||||||
|
opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
|
||||||
|
virtualisation.docker.enableNvidia = true;
|
||||||
|
virtualisation.podman.enableNvidia = true;
|
||||||
|
}
|
39
modules/sound-pipewire.nix
Normal file
39
modules/sound-pipewire.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
environment.systemPackages = with pkgs; [pulseaudio];
|
||||||
|
|
||||||
|
hardware.pulseaudio.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
jack.enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
media-session.enable = false;
|
||||||
|
wireplumber.enable = true;
|
||||||
|
config = {
|
||||||
|
pipewire."context.properties"."default.clock.allowed-rates" = [
|
||||||
|
44100
|
||||||
|
48000
|
||||||
|
88200
|
||||||
|
96000
|
||||||
|
176400
|
||||||
|
192000
|
||||||
|
358000
|
||||||
|
384000
|
||||||
|
716000
|
||||||
|
768000
|
||||||
|
];
|
||||||
|
pipewire-pulse."stream.properties"."resample.quality" = 15;
|
||||||
|
client."stream.properties"."resample.quality" = 15;
|
||||||
|
client-rt."stream.properties"."resample.quality" = 15;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
}
|
4
modules/yubikey.nix
Normal file
4
modules/yubikey.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
services.udev.packages = with pkgs; [yubikey-personalization libu2f-host];
|
||||||
|
services.pcscd.enable = true;
|
||||||
|
}
|
17
modules/zfs.nix
Normal file
17
modules/zfs.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
boot.supportedFilesystems = ["zfs"];
|
||||||
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [zfs];
|
||||||
|
|
||||||
|
services.zfs = {
|
||||||
|
autoScrub = {
|
||||||
|
enable = true;
|
||||||
|
interval = "weekly";
|
||||||
|
};
|
||||||
|
trim = {
|
||||||
|
enable = true;
|
||||||
|
interval = "weekly";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,17 +1,17 @@
|
||||||
{ pkgs, ... }: {
|
{pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./atuin.nix
|
#./atuin.nix
|
||||||
./bash.nix
|
#./bash.nix
|
||||||
./btop.nix
|
#./btop.nix
|
||||||
./fish.nix
|
#./fish.nix
|
||||||
./git.nix
|
#./git.nix
|
||||||
./htop.nix
|
#./htop.nix
|
||||||
./neovim
|
#./neovim
|
||||||
./ssh.nix
|
#./ssh.nix
|
||||||
./starship.nix
|
#./starship.nix
|
||||||
./tmux.nix
|
#./tmux.nix
|
||||||
./xdg.nix
|
#./xdg.nix
|
||||||
./zsh.nix
|
#./zsh.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
|
@ -27,28 +27,29 @@
|
||||||
rclone
|
rclone
|
||||||
ripgrep
|
ripgrep
|
||||||
rsync
|
rsync
|
||||||
|
tree
|
||||||
];
|
];
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";
|
l = "ls -lahF --group-directories-first --show-control-chars --quoting-style=escape --color=auto";
|
||||||
t="tree -F --dirsfirst -L 2"
|
t = "tree -F --dirsfirst -L 2";
|
||||||
tt="tree -F --dirsfirst -L 3 --filelimit 16"
|
tt = "tree -F --dirsfirst -L 3 --filelimit 16";
|
||||||
ttt="tree -F --dirsfirst -L 6 --filelimit 16"
|
ttt = "tree -F --dirsfirst -L 6 --filelimit 16";
|
||||||
cpr="rsync -axHAWXS --numeric-ids --info=progress2"
|
cpr = "rsync -axHAWXS --numeric-ids --info=progress2";
|
||||||
|
|
||||||
md="mkdir"
|
md = "mkdir";
|
||||||
rmd="rm --one-file-system -d"
|
rmd = "rm --one-file-system -d";
|
||||||
cp="cp -vi"
|
cp = "cp -vi";
|
||||||
mv="mv -vi"
|
mv = "mv -vi";
|
||||||
rm="rm --one-file-system -I"
|
rm = "rm --one-file-system -I";
|
||||||
chmod="chmod -c --preserve-root"
|
chmod = "chmod -c --preserve-root";
|
||||||
chown="chown -c --preserve-root"
|
chown = "chown -c --preserve-root";
|
||||||
|
|
||||||
vim="nvim"
|
vim = "nvim";
|
||||||
ip="ip --color"
|
ip = "ip --color";
|
||||||
tmux="tmux -2"
|
tmux = "tmux -2";
|
||||||
rg="rg -S"
|
rg = "rg -S";
|
||||||
|
|
||||||
p="cd ~/projects"
|
p = "cd ~/projects";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +61,6 @@
|
||||||
bat.enable = true;
|
bat.enable = true;
|
||||||
fzf.enable = true;
|
fzf.enable = true;
|
||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
zoxide.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."nixpkgs/config.nix".text = "{ allowUnfree = true; }";
|
xdg.configFile."nixpkgs/config.nix".text = "{ allowUnfree = true; }";
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
with lib;
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; {
|
||||||
users.groups.myuser.gid = config.users.users.myuser.uid;
|
users.groups.myuser.gid = config.users.users.myuser.uid;
|
||||||
users.users.myuser = {
|
users.users.myuser = {
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
group = "myuser";
|
group = "myuser";
|
||||||
extraGroups = [ "wheel" "input" "video" ]
|
extraGroups =
|
||||||
++ optionals config.sound.enable [ "audio" ];
|
["wheel" "input" "video"]
|
||||||
|
++ optionals config.sound.enable ["audio"];
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home = {
|
||||||
|
extraOutputsToInstall = ["doc" "devdoc"];
|
||||||
|
file.gdbinit = {
|
||||||
|
target = ".gdbinit";
|
||||||
|
text = ''
|
||||||
|
set auto-load safe-path /
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
packages = with pkgs; [
|
||||||
|
git-lfs
|
||||||
|
nix-update
|
||||||
|
nixpkgs-review
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
direnv = {
|
||||||
|
enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
stdlib = ''
|
||||||
|
: ''${XDG_CACHE_HOME:=$HOME/.cache}
|
||||||
|
declare -A direnv_layout_dirs
|
||||||
|
direnv_layout_dir() {
|
||||||
|
echo "''${direnv_layout_dirs[$PWD]:=$(
|
||||||
|
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
|
||||||
|
echo -n "$PWD" | shasum | cut -d ' ' -f 1
|
||||||
|
)}"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nix-index.enable = true;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue