Merge desktop and laptop changes

This commit is contained in:
langedev 2024-02-20 13:51:16 -08:00
commit a79d9a678d
9 changed files with 119 additions and 26 deletions

View file

@ -5,12 +5,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
systemType = "laptop"; #systemType = "laptop";
#systemType = "desktop"; systemType = "desktop";
in { in {
nix.package = pkgs.nixUnstable; nix.package = pkgs.nixUnstable;
imports = imports =
[ [
# Hardware Specific Configuration # Hardware Specific Configuration
./${systemType}.nix ./${systemType}.nix
@ -23,10 +23,11 @@ in {
./modules/audio/pipewire ./modules/audio/pipewire
./modules/shell/fish # This enables fish as the default shell #./modules/shell/fish
./modules/shell/xonsh
./modules/network/browsers/librewolf ./modules/network/browsers/librewolf
./modules/network/syncthing ./modules/network/syncthing
./modules/login/greetd ./modules/login/greetd
]; ];

View file

@ -5,6 +5,6 @@
imports = [ imports = [
./hardware/desktop.nix ./hardware/desktop.nix
# ./modules/graphics/nvidia ./modules/graphics/nvidia
]; ];
} }

55
flake.lock generated
View file

@ -9,11 +9,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1699808562, "lastModified": 1708215223,
"narHash": "sha256-wTU1ivhWAAGWO6Fzx4RYFruW8HrIh5X7fjy5NJPaqOc=", "narHash": "sha256-5z+NPNoiWKoaz3M4LZJ2fP+N7Vl9XGwr4QAV8rh4l4o=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "0ba2e6870478bcf1af1b6508677b46a3484fb21f", "rev": "683a4b07c514fa3c13cdf09e475283a69fcc7653",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -47,13 +47,35 @@
"type": "github" "type": "github"
} }
}, },
"hyprlang": {
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
]
},
"locked": {
"lastModified": 1704287638,
"narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1698134075, "lastModified": 1707546158,
"narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=", "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4", "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -65,11 +87,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1699825797, "lastModified": 1701902328,
"narHash": "sha256-W2m42mVt4/O6CJFbECPfLApmi8bO+qscbmSeEKrSHEg=", "narHash": "sha256-3tiiSEgQRPps0aV40belvLk1k4Max7oRh/+hZGLtfGc=",
"owner": "langedev", "owner": "langedev",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a69768a1c385042d46ff57396c49d26df5ac035c", "rev": "162f092c27afe0949253753f088c2babfba5b902",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -104,18 +126,18 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1699292815, "lastModified": 1706359063,
"narHash": "sha256-HXu98PyBMKEWLqiTb8viuLDznud/SdkdJsx5A5CWx7I=", "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1", "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1", "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
"type": "gitlab" "type": "gitlab"
} }
}, },
@ -125,6 +147,7 @@
"hyprland", "hyprland",
"hyprland-protocols" "hyprland-protocols"
], ],
"hyprlang": "hyprlang",
"nixpkgs": [ "nixpkgs": [
"hyprland", "hyprland",
"nixpkgs" "nixpkgs"
@ -135,11 +158,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697981233, "lastModified": 1706521509,
"narHash": "sha256-y8q4XUwx+gVK7i2eLjfR32lVo7TYvEslyzrmzYEaPZU=", "narHash": "sha256-AInZ50acOJ3wzUwGzNr1TmxGTMx+8j6oSTzz4E7Vbp8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "22e7a65ff9633e1dedfa5317fdffc49f68de2ff2", "rev": "c06fd88b3da492b8f9067be021b9184f7012b5a8",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -5,7 +5,7 @@
}; };
outputs = { nixpkgs, hyprland, ... }: { outputs = { nixpkgs, hyprland, ... }: {
nixosConfigurations.jibril = nixpkgs.lib.nixosSystem { nixosConfigurations.onizuka = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./configuration.nix ./configuration.nix

39
hardware/desktop.nix Normal file
View file

@ -0,0 +1,39 @@
# 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" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f3afdc38-7550-4113-9f87-10def35845e2";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/6D40-7FAB";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/743a10e1-a064-41e3-a0ae-59ca54cff1b1"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -5,6 +5,7 @@
services.pipewire = { services.pipewire = {
enable = true; enable = true;
wireplumber.enable = true;
alsa.enable = false; alsa.enable = false;
alsa.support32Bit = false; alsa.support32Bit = false;
pulse.enable = true; pulse.enable = true;

View file

@ -1,7 +1,21 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
services.xserver.videoDrivers = [ "nvidia" ]; # Enable OpenGL
hardware.opengl.enable = true; hardware.opengl = {
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; enable = true;
driSupport = true;
driSupport32Bit = true;
};
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
environment.systemPackages = with pkgs; [
nvidia-vaapi-driver
];
} }

View file

@ -0,0 +1,9 @@
{ config, pkgs, lib, ... }:
{
programs.xonsh.enable = true;
users.defaultUserShell = pkgs.xonsh;
environment.shells = with pkgs; [ xonsh ];
}

View file

@ -2,7 +2,9 @@
{ {
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.timeout = 1;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
@ -18,12 +20,16 @@
]; ];
# XDG Compliance # XDG Compliance
xdg.portal.config.common.default = "*";
environment.sessionVariables = rec { environment.sessionVariables = rec {
XDG_CONFIG_HOME = "\${HOME}/.config"; XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_CACHE_HOME = "\${HOME}/.cache"; XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_STATE_HOME = "\${HOME}/.local/state"; XDG_STATE_HOME = "\${HOME}/.local/state";
XDG_DATA_HOME = "\${HOME}/.local/share"; XDG_DATA_HOME = "\${HOME}/.local/share";
XDG_BIN_HOME = "\${HOME}/.local/bin"; XDG_BIN_HOME = "\${HOME}/.local/bin";
PATH = [
"\${HOME}/prog/scripts"
];
}; };
users.groups = { users.groups = {