add pleione

This commit is contained in:
Gabriel Fontes
2021-11-21 21:12:00 -03:00
parent 2bb0f7035d
commit 70be3cffc2
11 changed files with 269 additions and 145 deletions
+4 -3
View File
@@ -5,9 +5,10 @@ Here's my NixOS/home-manager config files. Requires [Nix flakes](https://nixos.w
## Structure
- `flake.nix`: Entrypoint for both hosts (`nixos-rebuild --flake`) and home configurations (`home-manager --flake`). Also exposes a devshell for boostrapping (`nix develop` or `nix-shell`).
- `hosts`: System-wide configuration for my machines.
- `atlas`: Desktop PC - 32GB RAM, R5 3600x, RX 5700XT | Runs sway. Development, production, and gaming.
- `merope`: Raspberry Pi 4 - 8GB RAM | Headless. Server usage.
- `maia`: Gf's PC - 16GB RAM, i5 6600, GTX 970 | Runs gnome. Production and gaming.
- `atlas`: Desktop PC - 32GB RAM, R5 3600x, RX 5700XT | Sway
- `pleione`: Lenovo Ideapad 3 - 8GB RAM, R7 5700u | Sway
- `merope`: Raspberry Pi 4 - 8GB RAM | Server
- `maia`: Gf's PC - 16GB RAM, i5 6600, GTX 970 | GNOME
- `users`: Home-manager configurations for my user(s)
- `misterio`: That's me!
- `layla`: My sweet sweet girl
Generated
+9 -9
View File
@@ -33,11 +33,11 @@
},
"hardware": {
"locked": {
"lastModified": 1637170060,
"narHash": "sha256-He3CaRefpj9VctY9NMqyYc8blkrJK7AIj7z8YBxohq4=",
"lastModified": 1637242070,
"narHash": "sha256-/XCFGOriSpAgo0lPxVK12vFBpta567kwfHZr5tNNHyE=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "ad0b7c5a9585f1b622560ab1a90b562a6ac45e18",
"rev": "5a7e613703ea349fd46b3fa2f3dfe3bd5444d591",
"type": "github"
},
"original": {
@@ -53,11 +53,11 @@
]
},
"locked": {
"lastModified": 1637188941,
"narHash": "sha256-4aA5iNVhSDbKjsPeG4n0SvfPQ3sd9ve23b05bVztSq4=",
"lastModified": 1637516270,
"narHash": "sha256-qTffAQ0kWA2qXMJUVMDsgXVbzMNI0BfR78vB/4QFA+o=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d85bf67c48f5c64ca39d3d48375e742e16933f4f",
"rev": "15ae861e1bfad90e0d14106551544e9e07cbcb10",
"type": "github"
},
"original": {
@@ -114,11 +114,11 @@
},
"nur": {
"locked": {
"lastModified": 1637199782,
"narHash": "sha256-syImCXb95JKOnwGVw17XvfvCz0ok4U6xVH67lCCqLDI=",
"lastModified": 1637526496,
"narHash": "sha256-kutOuCotz6YJlFJKbkLD22Z8eHjvVh0Z4llnBBMZbQE=",
"owner": "nix-community",
"repo": "NUR",
"rev": "467533257dda5b52185d8c2b78abe75095f259f1",
"rev": "801de698dcd0f84a4498683254294562c1a5d5cb",
"type": "github"
},
"original": {
+36 -75
View File
@@ -13,16 +13,15 @@ in
hardware.nixosModules.common-pc-ssd
impermanence.nixosModules.impermanence
nur-no-pkgs.repos.misterio.modules.openrgb
./hardware-configuration.nix
../common.nix
./hardware-configuration.nix
# ./gpu-overclock.nix
# ./satisfactory.nix
# ./droidcam.nix
];
networking.hostName = "atlas";
fileSystems."/data/var".neededForBoot = true;
fileSystems."/data/home".neededForBoot = true;
environment.persistence."/data" = {
directories = [
"/var/log"
@@ -34,23 +33,17 @@ in
};
boot = {
binfmt.emulatedSystems = [ "aarch64-linux" ];
# Kernel
kernelPackages = pkgs.linuxPackages_zen;
# Plymouth (currently only starts at phase 2)
plymouth = {
enable = true;
font = "${pkgs.fira}/share/fonts/opentype/FiraSans-Regular.otf";
};
kernelPackages = pkgs.linuxPackages_zen;
# More silent boot
kernelParams = [ "quiet" "udev.log_priority=3" ];
kernel.sysctl = {
"vm.max_map_count" = 16777216;
"abi.vsyscall32" = 0;
};
kernelModules = [ "v4l2loopback" "i2c-dev" "i2c-piix4" ];
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 video_nr=9 card_label=a7III
'';
consoleLogLevel = 3;
supportedFilesystems = [ "btrfs" ];
# Bootloader configuration
loader = {
timeout = 0;
systemd-boot = {
@@ -60,6 +53,15 @@ in
};
efi.canTouchEfiVariables = true;
};
# Allow compiling to ARM64
binfmt.emulatedSystems = [ "aarch64-linux" ];
# Let's me play star citizen and lol
kernel.sysctl = {
"vm.max_map_count" = 16777216;
"abi.vsyscall32" = 0;
};
# Enables overclocking of gpu
initrd.kernelParams = [ "amdgpu.ppfeaturemask=0xfff7ffff" ];
};
services = {
@@ -75,20 +77,6 @@ in
};
programs = {
adb.enable = true;
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
};
dconf.enable = true;
# droidcam.enable = true;
kdeconnect.enable = true;
gamemode = {
enable = true;
settings = {
@@ -97,59 +85,35 @@ in
gpu_device = 0;
amd_performance_level = "high";
};
custom =
let
startHook = pkgs.writeShellScriptBin "start-hook.sh" ''
${pkgs.systemd}/bin/systemctl --user stop ethminer
SUDO_ASKPASS=${pkgs.zenity-askpass}/bin/zenity-askpass /run/wrappers/bin/sudo -A USER_STATES_PATH=/etc/default/amdgpu-gaming-state ${pkgs.amdgpu-clocks}/bin/amdgpu-clocks
'';
endHook = pkgs.writeShellScriptBin "end-hook.sh" ''
${pkgs.systemd}/bin/systemctl --user start ethminer
# SUDO_ASKPASS=${pkgs.zenity-askpass}/bin/zenity-askpass /run/wrappers/bin/sudo -A USER_STATES_PATH=/etc/default/amdgpu-custom-state ${pkgs.amdgpu-clocks}/bin/amdgpu-clocks
'';
in {
start = "${startHook}/bin/start-hook.sh";
end = "${endHook}/bin/end-hook.sh";
custom = {
start = "${pkgs.systemd}/bin/systemctl --user stop ethminer";
end = "${pkgs.systemd}/bin/systemctl --user start ethminer";
};
};
};
# Use GPG as SSH
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
};
adb.enable = true;
dconf.enable = true;
kdeconnect.enable = true;
};
security = {
rtkit.enable = true;
# Global sudo caching
sudo.extraConfig = ''
Defaults timestamp_type=global
'';
};
environment.systemPackages = with pkgs; [
amdgpu-clocks
];
environment.etc = {
"default/amdgpu-custom-state.card0".text = ''
OD_SCLK:
1: 1400Mhz
OD_MCLK:
1: 890MHz
OD_VDDC_CURVE:
0: 1400MHz 880mV
FORCE_POWER_CAP: 150000000
'';
"default/amdgpu-gaming-state.card0".text = ''
OD_SCLK:
1: 2009Mhz
OD_MCLK:
1: 875MHz
OD_VDDC_CURVE:
0: 800MHz 780mV
1: 1404MHz 826mV
2: 2009MHz 1197mV
FORCE_PERF_LEVEL: auto
FORCE_POWER_CAP: 190000000
'';
};
xdg.portal = {
enable = true;
@@ -168,19 +132,16 @@ in
openrgb.enable = true;
opentabletdriver.enable = true;
steam-hardware.enable = true;
# pulseaudio.enable = true;
};
virtualisation = {
podman.enable = true;
};
# My user info
users.users.misterio = {
isNormalUser = true;
extraGroups = [ "audio" "wheel" "networkmanager" "plugdev" "adbusers"];
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
passwordFile = "/data/home/misterio/.password";
openssh.authorizedKeys.keys = [
+6
View File
@@ -0,0 +1,6 @@
{
boot.extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 video_nr=9 card_label=a7III
'';
programs.droidcam.enable = true;
}
+16 -20
View File
@@ -1,19 +1,15 @@
# 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 =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "amdgpu" ];
boot.initrd.luks.devices."nixenc".device =
"/dev/disk/by-uuid/320599e3-21f9-465e-a2f2-d078eccc34c0";
boot.kernelParams = [
"amdgpu.ppfeaturemask=0xfff7ffff"
];
boot.extraModulePackages = [ ];
boot = {
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
luks.devices."atlas".device = "/dev/disk/by-label/Atlas";
};
supportedFilesystems = [ "btrfs" ];
};
fileSystems = {
"/" = {
@@ -23,47 +19,47 @@
};
"/boot" = {
device = "/dev/disk/by-uuid/28E4-87AC";
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
"/data/games" = {
device = "/dev/disk/by-uuid/53b00f4f-1dee-4aae-bc96-3982f2b04c90";
device = "/dev/mapper/atlas";
fsType = "btrfs";
options = [ "subvol=data/games" "compress=zstd" ];
};
"/data/home" = {
device = "/dev/disk/by-uuid/53b00f4f-1dee-4aae-bc96-3982f2b04c90";
device = "/dev/mapper/atlas";
fsType = "btrfs";
options = [ "subvol=data/home" "compress=zstd" ];
neededForBoot = true;
};
"/data/srv" = {
device = "/dev/disk/by-uuid/53b00f4f-1dee-4aae-bc96-3982f2b04c90";
device = "/dev/mapper/atlas";
fsType = "btrfs";
options = [ "subvol=data/srv" "compress=zstd" ];
};
"/data/var" = {
device = "/dev/disk/by-uuid/53b00f4f-1dee-4aae-bc96-3982f2b04c90";
device = "/dev/mapper/atlas";
fsType = "btrfs";
options = [ "subvol=data/var" "compress=zstd" ];
neededForBoot = true;
};
"/dotfiles" = {
device = "/dev/disk/by-uuid/53b00f4f-1dee-4aae-bc96-3982f2b04c90";
device = "/dev/mapper/atlas";
fsType = "btrfs";
options = [ "subvol=dotfiles" "compress=zstd" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/53b00f4f-1dee-4aae-bc96-3982f2b04c90";
device = "/dev/mapper/atlas";
fsType = "btrfs";
options = [ "subvol=nix" "noatime" "compress=zstd" ];
};
};
swapDevices = [ ];
}
+1
View File
@@ -68,6 +68,7 @@
};
};
};
programs = {
fuse.userAllowOther = true;
fish = {
+23 -27
View File
@@ -1,48 +1,44 @@
# 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")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
luks.devices."nixenc".device = "/dev/disk/by-uuid/32d93839-2606-4472-a4ba-01b8510937bb";
};
kernelModules = [ "kvm-intel" ];
};
boot.initrd.luks.devices."nixenc".device = "/dev/disk/by-uuid/32d93839-2606-4472-a4ba-01b8510937bb";
fileSystems."/" =
{ device = "none";
fileSystems = {
"/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=4G" "mode=755" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/96C2-490B";
"/boot" = {
device = "/dev/disk/by-uuid/96C2-490B";
fsType = "vfat";
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/9ded8eaf-5411-425b-9664-1208aadd11b9";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
fileSystems."/data" =
{ device = "/dev/disk/by-uuid/9ded8eaf-5411-425b-9664-1208aadd11b9";
"/data" = {
device = "/dev/disk/by-uuid/9ded8eaf-5411-425b-9664-1208aadd11b9";
fsType = "btrfs";
options = [ "subvol=data" "compress=zstd" ];
};
fileSystems."/dotfiles" =
{ device = "/dev/disk/by-uuid/9ded8eaf-5411-425b-9664-1208aadd11b9";
"/dotfiles" = {
device = "/dev/disk/by-uuid/9ded8eaf-5411-425b-9664-1208aadd11b9";
fsType = "btrfs";
options = [ "subvol=dotfiles" "compress=zstd" ];
};
swapDevices = [ ];
"/nix" = {
device = "/dev/disk/by-uuid/9ded8eaf-5411-425b-9664-1208aadd11b9";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ];
};
};
}
+1 -11
View File
@@ -1,17 +1,9 @@
# 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")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems = {
"/" = {
@@ -47,7 +39,5 @@
};
};
swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
}
+1
View File
@@ -0,0 +1 @@
wg*.nix
+107
View File
@@ -0,0 +1,107 @@
# System configuration for my laptop
{ config, nixpkgs, pkgs, hardware, nur, impermanence, system, ... }:
{
imports = [
hardware.nixosModules.common-cpu-amd
hardware.nixosModules.common-gpu-amd
hardware.nixosModules.common-pc-ssd
impermanence.nixosModules.impermanence
./hardware-configuration.nix
../common.nix
];
networking.hostName = "pleione";
environment.persistence."/data" = {
directories = [
"/var/log"
"/var/lib/containers"
"/var/lib/systemd"
"/var/lib/postgresql"
"/srv"
];
};
boot = {
# Kernel
kernelPackages = pkgs.linuxPackages_zen;
# Plymouth (currently only starts at phase 2)
plymouth = {
enable = true;
font = "${pkgs.fira}/share/fonts/opentype/FiraSans-Regular.otf";
};
# More silent boot
kernelParams = [ "quiet" "udev.log_priority=3" ];
consoleLogLevel = 3;
# Bootloader configuration
loader = {
timeout = 0;
systemd-boot = {
enable = true;
consoleMode = "max";
editor = false;
};
efi.canTouchEfiVariables = true;
};
};
services = {
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
dbus.packages = [ pkgs.gcr ];
postgresql.enable = true;
};
programs = {
gamemode.enable = true;
# Use GPG as SSH
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
steam.enable = true;
adb.enable = true;
dconf.enable = true;
kdeconnect.enable = true;
};
security = {
# Global sudo caching
sudo.extraConfig = ''
Defaults timestamp_type=global
'';
};
xdg.portal = {
enable = true;
gtkUsePortal = true;
extraPortals = with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ];
};
security.pam.services.swaylock = { };
hardware.steam-hardware.enable = true;
virtualisation = {
podman.enable = true;
};
# My user info
users.users.misterio = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
passwordFile = "/data/home/misterio/.password";
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDci4wJghnRRSqQuX1z2xeaUR+p/muKzac0jw0mgpXE2T/3iVlMJJ3UXJ+tIbySP6ezt0GVmzejNOvUarPAm0tOcW6W0Ejys2Tj+HBRU19rcnUtf4vsKk8r5PW5MnwS8DqZonP5eEbhW2OrX5ZsVyDT+Bqrf39p3kOyWYLXT2wA7y928g8FcXOZjwjTaWGWtA+BxAvbJgXhU9cl/y45kF69rfmc3uOQmeXpKNyOlTk6ipSrOfJkcHgNFFeLnxhJ7rYxpoXnxbObGhaNqn7gc5mt+ek+fwFzZ8j6QSKFsPr0NzwTFG80IbyiyrnC/MeRNh7SQFPAESIEP8LK3PoNx2l1M+MjCQXsb4oIG2oYYMRa2yx8qZ3npUOzMYOkJFY1uI/UEE/j/PlQSzMHfpmWus4o2sijfr8OmVPGeoU/UnVPyINqHhyAd1d3Iji3y3LMVemHtp5wVcuswABC7IRVVKZYrMCXMiycY5n00ch6XTaXBwCY00y8B3Mzkd7Ofq98YHc= (none)"
];
};
}
+65
View File
@@ -0,0 +1,65 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
luks.devices."pleione".device = "/dev/disk/by-label/Pleione";
};
supportedFilesystems = [ "btrfs" ];
};
fileSystems = {
"/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "size=4G" "mode=755" ];
};
"/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
"/data/games" = {
device = "/dev/mapper/pleione";
fsType = "btrfs";
options = [ "subvol=data/games" "compress=zstd" ];
};
"/data/home" = {
device = "/dev/mapper/pleione";
fsType = "btrfs";
options = [ "subvol=data/home" "compress=zstd" ];
neededForBoot = true;
};
"/data/srv" = {
device = "/dev/mapper/pleione";
fsType = "btrfs";
options = [ "subvol=data/srv" "compress=zstd" ];
};
"/data/var" = {
device = "/dev/mapper/pleione";
fsType = "btrfs";
options = [ "subvol=data/var" "compress=zstd" ];
neededForBoot = true;
};
"/dotfiles" = {
device = "/dev/mapper/pleione";
fsType = "btrfs";
options = [ "subvol=dotfiles" "compress=zstd" ];
};
"/nix" = {
device = "/dev/mapper/pleione";
fsType = "btrfs";
options = [ "subvol=nix" "noatime" "compress=zstd" ];
};
};
}