move things around
This commit is contained in:
parent
63b9b81ebe
commit
c9f0f903a3
26 changed files with 9 additions and 8 deletions
107
hosts/winter/audio.nix
Normal file
107
hosts/winter/audio.nix
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
int = {
|
||||
quantum = {
|
||||
min = 256;
|
||||
def = 512;
|
||||
max = 2048;
|
||||
};
|
||||
rate = 48000;
|
||||
};
|
||||
str = {
|
||||
quantum = {
|
||||
min = toString int.quantum.min;
|
||||
def = toString int.quantum.def;
|
||||
max = toString int.quantum.max;
|
||||
};
|
||||
rate = toString int.rate;
|
||||
};
|
||||
in {
|
||||
sound.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
|
||||
config.pipewire = {
|
||||
"context.properties" = {
|
||||
"link.max-buffers" = 16;
|
||||
"default.clock.rate" = int.rate;
|
||||
"default.clock.quantum" = int.quantum.def;
|
||||
"default.clock.min-quantum" = int.quantum.min;
|
||||
"default.clock.max-quantum" = int.quantum.max;
|
||||
"core.daemon" = true;
|
||||
"core.name" = "pipewire-0";
|
||||
};
|
||||
|
||||
"context.modules" = [
|
||||
{
|
||||
name = "libpipewire-module-rtkit";
|
||||
args = {
|
||||
"nice.level" = -15;
|
||||
"rt.prio" = 88;
|
||||
"rt.time.soft" = 200000;
|
||||
"rt.time.hard" = 200000;
|
||||
};
|
||||
flags = [ "ifexists" "nofail" ];
|
||||
}
|
||||
{ name = "libpipewire-module-protocol-native"; }
|
||||
{ name = "libpipewire-module-profiler"; }
|
||||
{ name = "libpipewire-module-metadata"; }
|
||||
{ name = "libpipewire-module-spa-device-factory"; }
|
||||
{ name = "libpipewire-module-spa-node-factory"; }
|
||||
{ name = "libpipewire-module-client-node"; }
|
||||
{ name = "libpipewire-module-client-device"; }
|
||||
{
|
||||
name = "libpipewire-module-portal";
|
||||
flags = [ "ifexists" "nofail" ];
|
||||
}
|
||||
{ name = "libpipewire-module-access"; args = {}; }
|
||||
{ name = "libpipewire-module-adapter"; }
|
||||
{ name = "libpipewire-module-link-factory"; }
|
||||
{ name = "libpipewire-module-session-manager"; }
|
||||
];
|
||||
"stream.properties" = {
|
||||
"node.latency" = "${str.quantum.min}/${str.rate}";
|
||||
"resample.quality" = 1;
|
||||
};
|
||||
};
|
||||
config.pipewire-pulse = {
|
||||
"context.modules" = [
|
||||
{
|
||||
name = "libpipewire-module-rtkit";
|
||||
args = {
|
||||
"nice.level" = -15;
|
||||
"rt.prio" = 88;
|
||||
"rt.time.soft" = 200000;
|
||||
"rt.time.hard" = 200000;
|
||||
};
|
||||
flags = [ "ifexists" "nofail" ];
|
||||
}
|
||||
{ name = "libpipewire-module-protocol-native"; }
|
||||
{ name = "libpipewire-module-client-node"; }
|
||||
{ name = "libpipewire-module-adapter"; }
|
||||
{ name = "libpipewire-module-metadata"; }
|
||||
{
|
||||
name = "libpipewire-module-protocol-pulse";
|
||||
args = {
|
||||
"pulse.min.req" = "${str.quantum.min}/${str.rate}";
|
||||
"pulse.default.req" = "${str.quantum.def}/${str.rate}";
|
||||
"pulse.max.req" = "${str.quantum.max}/${str.rate}";
|
||||
"pulse.min.quantum" = "${str.quantum.min}/${str.rate}";
|
||||
"pulse.max.quantum" = "${str.quantum.max}/${str.rate}";
|
||||
"server.address" = [ "unix:native" ];
|
||||
};
|
||||
}
|
||||
];
|
||||
"stream.properties" = {
|
||||
"node.latency" = "${str.quantum.min}/${str.rate}";
|
||||
"resample.quality" = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
45
hosts/winter/default.nix
Normal file
45
hosts/winter/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ config, overlays, pkgs, ... }: {
|
||||
networking.hostName = "winter";
|
||||
system.stateVersion = "20.09";
|
||||
|
||||
environment.etc = {
|
||||
"machine-id".source = "/mnt/bcachefs/machine-id";
|
||||
"ssh/ssh_host_rsa_key".source = "/mnt/bcachefs/ssh_host_rsa_key";
|
||||
"ssh/ssh_host_rsa_key.pub".source = "/mnt/bcachefs/ssh_host_rsa_key.pub";
|
||||
"ssh/ssh_host_ed25519_key".source = "/mnt/bcachefs/ssh_host_ed25519_key";
|
||||
"ssh/ssh_host_ed25519_key.pub".source = "/mnt/bcachefs/ssh_host_ed25519_key.pub";
|
||||
};
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
users.mutableUsers = false;
|
||||
|
||||
imports = [
|
||||
./audio.nix
|
||||
./gui.nix
|
||||
./hardware-configuration.nix
|
||||
./kernel.nix
|
||||
./networking.nix
|
||||
./packages.nix
|
||||
./security.nix
|
||||
|
||||
../../users/rin
|
||||
];
|
||||
nix = {
|
||||
package = pkgs.nixUnstable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
nixpkgs.overlays = with overlays; [
|
||||
discord
|
||||
linux
|
||||
polybar
|
||||
picom
|
||||
wine-osu
|
||||
winetricks
|
||||
];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
console.useXkbConfig = true;
|
||||
}
|
||||
|
||||
60
hosts/winter/gui.nix
Normal file
60
hosts/winter/gui.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
fonts = {
|
||||
enableDefaultFonts = true;
|
||||
fontconfig = {
|
||||
defaultFonts = {
|
||||
serif = ["NotoSerif"];
|
||||
sansSerif = ["NotoSans"];
|
||||
monospace = ["CascadiaCode"];
|
||||
};
|
||||
};
|
||||
fonts = with pkgs; [
|
||||
cascadia-code
|
||||
font-awesome-ttf
|
||||
font-awesome_4
|
||||
hanazono
|
||||
material-icons
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-extra
|
||||
open-sans
|
||||
twemoji-color-font
|
||||
unifont
|
||||
];
|
||||
};
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
autorun = false;
|
||||
displayManager = {
|
||||
lightdm.enable = lib.mkForce false;
|
||||
startx.enable = true;
|
||||
xserverArgs = [
|
||||
"-ardelay 250"
|
||||
"-arinterval 15"
|
||||
];
|
||||
};
|
||||
desktopManager.xterm.enable = false;
|
||||
libinput = {
|
||||
enable = true;
|
||||
mouse = {
|
||||
accelSpeed = "0";
|
||||
accelProfile = "flat";
|
||||
};
|
||||
};
|
||||
xkbOptions = "caps:escape";
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
package = pkgs.i3-gaps;
|
||||
extraPackages = with pkgs; [
|
||||
dunst
|
||||
feh
|
||||
lxappearance
|
||||
maim
|
||||
picom
|
||||
polybar
|
||||
rofi
|
||||
xclip
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
70
hosts/winter/hardware-configuration.nix
Normal file
70
hosts/winter/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" "bcachefs" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [ "defaults" "size=4G" "mode=755" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/E8E8-E570";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
fileSystems."/mnt/bcachefs" =
|
||||
{ device = "/dev/sda2";
|
||||
fsType = "bcachefs";
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "/mnt/bcachefs/binds/nix";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/mnt/bcachefs/binds/home";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/var" =
|
||||
{ device = "/mnt/bcachefs/binds/var";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/root" =
|
||||
{ device = "/mnt/bcachefs/binds/root";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/etc/nixos" =
|
||||
{ device = "/mnt/bcachefs/binds/etc_nixos";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/hdd" =
|
||||
{ device = "/dev/disk/by-uuid/d5e3cfe5-c73a-4695-b81b-fc0215d4cefe";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
}
|
||||
34
hosts/winter/kernel.nix
Normal file
34
hosts/winter/kernel.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, pkgs, ...}: {
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
};
|
||||
};
|
||||
supportedFilesystems = ["bcachefs"];
|
||||
blacklistedKernelModules = [
|
||||
"uvcvideo"
|
||||
];
|
||||
initrd = {
|
||||
includeDefaultModules = false;
|
||||
kernelModules = [ "i915" ];
|
||||
};
|
||||
kernel.sysctl = {
|
||||
"kernel.sysrq" = 1;
|
||||
};
|
||||
kernelParams = [
|
||||
"amdgpu.gpu_recovery=1"
|
||||
"amdgpu.si_support=1"
|
||||
"radeon.si_support=0"
|
||||
"intel_pstate=passive"
|
||||
"msr.allow_writes=on"
|
||||
];
|
||||
kernelPackages = pkgs.lib.mkForce pkgs.linux-lava;
|
||||
};
|
||||
zramSwap.enable = true;
|
||||
}
|
||||
18
hosts/winter/networking.nix
Normal file
18
hosts/winter/networking.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, ... }: {
|
||||
networking.wireless.enable = true;
|
||||
|
||||
networking.useDHCP = false;
|
||||
networking.interfaces.eno1.useDHCP = false;
|
||||
networking.interfaces.wlp3s0.useDHCP = false;
|
||||
|
||||
networking.interfaces.eno1.ipv4.addresses = [{
|
||||
address = "10.0.0.2";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
networking.interfaces.wlp3s0.ipv4.addresses = [{
|
||||
address = "192.168.100.13";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
networking.defaultGateway = "192.168.100.1";
|
||||
networking.nameservers = ["192.168.100.11"];
|
||||
}
|
||||
28
hosts/winter/packages.nix
Normal file
28
hosts/winter/packages.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ config, pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
gparted
|
||||
htop
|
||||
libarchive
|
||||
lf
|
||||
msr-tools
|
||||
ncdu
|
||||
neovim
|
||||
rsync
|
||||
wget
|
||||
|
||||
gnome3.nautilus
|
||||
|
||||
(pkgs.writeShellScriptBin "nix-flakes" ''
|
||||
exec ${pkgs.nixUnstable}/bin/nix --experimental-features "nix-command flakes" "$@"
|
||||
'')
|
||||
];
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
programs.light.enable = true;
|
||||
hardware.opentabletdriver.enable = true;
|
||||
programs.steam.enable = true;
|
||||
services.dbus.packages = [ pkgs.gnome3.dconf ];
|
||||
services.gnome.sushi.enable = true;
|
||||
services.ipfs.enable = true;
|
||||
}
|
||||
24
hosts/winter/security.nix
Normal file
24
hosts/winter/security.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, pkgs, ... }: {
|
||||
networking.firewall.enable = false;
|
||||
services.openssh.enable = true;
|
||||
|
||||
security = {
|
||||
polkit.enable = true;
|
||||
sudo.enable = false;
|
||||
doas = {
|
||||
enable = true;
|
||||
extraRules = [
|
||||
{
|
||||
groups = ["wheel"];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "gnome3";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue