Compare commits

...

3 Commits

Author SHA1 Message Date
f72a2e8b47
flake update 2023-07-21 22:08:30 +02:00
7442cb7b95
hosts: steamdeck: add initial config 2023-07-21 22:07:21 +02:00
19b91aebd9
flake: remove hyprland since it's in nixpkgs now 2023-07-21 21:27:26 +02:00
7 changed files with 355 additions and 109 deletions

116
flake.lock generated
View File

@ -72,11 +72,11 @@
]
},
"locked": {
"lastModified": 1689362769,
"narHash": "sha256-5V7Z7T9019pGsFnYH6va5h6Wveq8FKmXa/xLfj0DhNI=",
"lastModified": 1689891262,
"narHash": "sha256-Pc4wDczbdgd6QXKJIXprgxe7L9AVDsoAkMnvm5vmpUU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c1cdce3d89741d402d8fd2c93e3d2643ff85b053",
"rev": "ee5673246de0254186e469935909e821b8f4ec15",
"type": "github"
},
"original": {
@ -85,47 +85,20 @@
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": [
"nixpkgs"
],
"wlroots": "wlroots",
"xdph": "xdph"
},
"jovian-nixos": {
"flake": false,
"locked": {
"lastModified": 1689357751,
"narHash": "sha256-72rOd/X5dyO/5fxmeXz5oT13/Di5C71nyEj534rU2T4=",
"owner": "vaxerski",
"repo": "Hyprland",
"rev": "459afcc47f7a8fd0b85c4b89645099e2643732b3",
"lastModified": 1689533373,
"narHash": "sha256-/eTz8SCXRw2DTWM1AwRt7jA3FeZBVZIqmVze67TcBjg=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "8a934c6ebf10d0a153f0b62d933f7946e67f610f",
"type": "github"
},
"original": {
"owner": "vaxerski",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1684265364,
"narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"owner": "Jovian-Experiments",
"ref": "development",
"repo": "Jovian-NixOS",
"type": "github"
}
},
@ -147,11 +120,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1689282004,
"narHash": "sha256-VNhuyb10c9SV+3hZOlxwJwzEGytZ31gN9w4nPCnNvdI=",
"lastModified": 1689850295,
"narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e74e68449c385db82de3170288a28cd0f608544f",
"rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0",
"type": "github"
},
"original": {
@ -163,11 +136,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1689326639,
"narHash": "sha256-79zi0t83Dcc2dE0NuYZ+2hqtKXZN1yWVq5mtx8D2d7Y=",
"lastModified": 1689885880,
"narHash": "sha256-2ikAcvHKkKh8J/eUrwMA+wy1poscC+oL1RkN1V3RmT8=",
"owner": "NixOS",
"repo": "nIxpkgs",
"rev": "9fdfaeb7b96f05e869f838c73cde8d98c640c649",
"rev": "fa793b06f56896b7d1909e4b69977c7bf842b2f0",
"type": "github"
},
"original": {
@ -179,11 +152,11 @@
},
"nur": {
"locked": {
"lastModified": 1689410836,
"narHash": "sha256-Qkf1t2tGa+q/QKb5C8W5URpGNWYOoN3JmoPxEuCHXjE=",
"lastModified": 1689968828,
"narHash": "sha256-5qA6R/cBeLsS09ZMRKzhJq74nOGWEgGYpjdbKXDnCow=",
"owner": "nix-community",
"repo": "NUR",
"rev": "35a136b97a64ee17fa03c0f16b6815b5289f6045",
"rev": "876b9498f36a394fcf8472f62ecf6685585c0509",
"type": "github"
},
"original": {
@ -196,55 +169,12 @@
"inputs": {
"agenix": "agenix",
"home-manager": "home-manager_2",
"hyprland": "hyprland",
"jovian-nixos": "jovian-nixos",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
"nur": "nur"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1686753331,
"narHash": "sha256-KovjVFwcuoUO0eu/UiWrnD3+m/K+SHSAVIz4xF9K1XA=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "7e7633abf09b362d0bad9e3fc650fd692369291d",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1685385764,
"narHash": "sha256-r+XMyOoRXq+hlfjayb+fyi9kq2JK48TrwuNIAXqlj7U=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "4d9ff0c17716936e0b5ca577a39e263633901ed1",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",

View File

@ -24,18 +24,18 @@
url = "github:nix-community/NUR"; # NUR Packages
};
hyprland = { # Official Hyprland flake
url = "github:vaxerski/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
jovian-nixos = {
url = "github:Jovian-Experiments/Jovian-NixOS/development";
flake = false;
};
};
outputs = inputs @ { self, nixpkgs, nixpkgs-stable, nixos-hardware, home-manager, nur, hyprland, agenix, ... }: # Function that tells my flake which to use and what do what to do with the dependencies.
outputs = inputs @ { self, nixpkgs, nixpkgs-stable, nixos-hardware, home-manager, nur, agenix, jovian-nixos, ... }: # Function that tells my flake which to use and what do what to do with the dependencies.
let # Variables that can be used in the config files
user = "kabbone";
location = "$HOME/.setup";
@ -44,7 +44,7 @@
nixosConfigurations = ( # NixOS configurations
import ./hosts { # Imports ./hosts/default.nix
inherit (nixpkgs) lib;
inherit inputs nixpkgs nixpkgs-stable nixos-hardware home-manager nur user location hyprland agenix; # Also inherit home-manager so it does not need to be defined here.
inherit inputs nixpkgs nixpkgs-stable nixos-hardware home-manager nur user location agenix jovian-nixos; # Also inherit home-manager so it does not need to be defined here.
}
);
};

View File

@ -166,8 +166,6 @@
nix = { # Nix Package Manager settings
settings ={
auto-optimise-store = true; # Optimise syslinks
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
gc = { # Automatic garbage collection
automatic = true;

View File

@ -11,7 +11,7 @@
# └─ ./home.nix
#
{ lib, inputs, nixpkgs, nixos-hardware, home-manager, nur, user, location, hyprland, agenix, ... }:
{ lib, inputs, nixpkgs, nixos-hardware, home-manager, nur, user, location, agenix, jovian-nixos, ... }:
let
system = "x86_64-linux"; # System architecture
@ -27,11 +27,10 @@ in
{
desktop = lib.nixosSystem { # Desktop profile
inherit system;
specialArgs = { inherit inputs user location hyprland nixos-hardware nur agenix; };
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
#hyprland.nixosModules.default
./desktop
./configuration_desktop.nix
nixos-hardware.nixosModules.common-cpu-amd
@ -55,11 +54,10 @@ in
laptop = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location hyprland nixos-hardware nur agenix; };
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
#hyprland.nixosModules.default
./laptop
./configuration_desktop.nix
nixos-hardware.nixosModules.common-cpu-intel
@ -80,6 +78,32 @@ in
];
};
steamdeck = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location nixos-hardware nur agenix jovian-nixos; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./steamdeck
./configuration_desktop.nix
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-gpu-amd
nixos-hardware.nixosModules.common-pc-ssd
home-manager.nixosModules.home-manager {
nixpkgs.overlays = [
nur.overlay
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.users.${user} = {
imports = [(import ./home.nix)] ++ [(import ./steamdeck/home.nix)];
};
}
];
};
dmz = lib.nixosSystem { # Desktop profile
inherit system;
#user = "dmz-user";
@ -135,9 +159,8 @@ in
q920 = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location hyprland; };
specialArgs = { inherit inputs user location ; };
modules = [
hyprland.nixosModules.default
./q920
./configuration.nix

View File

@ -0,0 +1,87 @@
#
# Specific system configuration settings for desktop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ ├─ default.nix *
# │ └─ hardware-configuration.nix
# └─ ./modules
# ├─ ./desktop
# │ └─ ./hyprland
# │ └─ hyprland.nix
# ├─ ./modules
# │ └─ ./programs
# │ └─ waybar.nix
# └─ ./hardware
# └─ default.nix
#
{ config, pkgs, user, ... }:
{
imports = # For now, if applying to other system, swap files
[(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
#[(import ../../modules/desktop/hyprland/default.nix)] ++ # Window Manager
[(import ../../modules/desktop/sway/default.nix)] ++ # Window Manager
[(import ../../modules/desktop/virtualisation/default.nix)] ++ # Docker
(import ../../modules/hardware); # Hardware devices
boot = { # Boot options
kernelPackages = pkgs.linuxPackages_latest;
loader = { # EFI Boot
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
timeout = 1; # Grub auto select time
};
};
# hardware.sane = { # Used for scanning with Xsane
# enable = false;
# extraBackends = [ pkgs.sane-airscan ];
# };
hardware = {
nitrokey.enable = true;
};
# environment = {
# systemPackages = with pkgs; [
## alacritty
# ];
# };
programs = { # No xbacklight, this is the alterantive
dconf.enable = true;
light.enable = true;
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "curses";
};
steam.enable = true;
};
services = {
blueman.enable = true;
printing = { # Printing and drivers for TS5300
enable = true;
drivers = [ pkgs.gutenprint ];
};
avahi = { # Needed to find wireless printer
enable = true;
nssmdns = true;
publish = { # Needed for detecting the scanner
enable = true;
addresses = true;
userServices = true;
};
};
tailscale.enable = true;
};
}

View File

@ -0,0 +1,151 @@
#
# Hardware settings for Teclast F5 10" Laptop
# NixOS @ sda2
#
# flake.nix
# └─ ./hosts
# └─ ./laptop
# └─ hardware-configuration.nix *
#
# 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" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.kernelParams = [ ];
boot.tmp.useTmpfs = true;
zramSwap.enable = true;
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [
"/"
];
};
services.btrbk = {
instances = {
hf = {
onCalendar = "hourly";
settings = {
incremental = "yes";
snapshot_create = "ondemand";
snapshot_dir = "@snapshots";
timestamp_format = "long";
snapshot_preserve = "2m 2w 5d 5h";
snapshot_preserve_min = "latest";
volume = {
"/mnt/snapshots/root" = {
snapshot_create = "always";
subvolume = {
"@home" = {};
};
};
};
};
};
};
};
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
};
fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
};
fileSystems."/mnt/snapshots/root" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
fileSystems."/sdcard" =
{ device = "/dev/disk/by-label/sdcard";
fsType = "ext4";
options = [ "nofail" "x-systemd.automount" ];
};
fileSystems."/mnt/Pluto" =
{ device = "nas:/Pluto";
fsType = "nfs";
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2" ];
};
fileSystems."/mnt/Mars" =
{ device = "nas:/Mars";
fsType = "nfs";
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2" ];
};
swapDevices = [
{ device = "/dev/disk/by-label/NIXSWAP"; }
];
networking = {
useDHCP = false; # Deprecated
hostName = "nix-steamdeck";
wireless.iwd.enable = true;
networkmanager = {
enable = true;
wifi = {
backend = "iwd";
powersave = true;
};
};
# interfaces = {
# wlan0 = {
# useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
# #ipv4.addresses = [ {
# # address = "192.168.0.51";
# # prefixLength = 24;
# #} ];
# };
# };
#defaultGateway = "192.168.0.1";
#nameservers = [ "192.168.0.4" ];
firewall = {
checkReversePath = "loose";
# enable = false;
# #allowedUDPPorts = [ 53 67 ];
# #allowedTCPPorts = [ 53 80 443 9443 ];
};
};
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

57
hosts/steamdeck/home.nix Normal file
View File

@ -0,0 +1,57 @@
#
# Home-manager configuration for laptop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ home.nix *
# └─ ./modules
# └─ ./desktop
# └─ ./hyprland
# └─ hyprland.nix
#
{ pkgs, ... }:
{
imports =
[
#../../modules/desktop/hyprland/home.nix # Window Manager
../../modules/desktop/sway/home.nix # Window Manager
../../modules/home.nix # Window Manager
];
home = { # Specific packages for laptop
packages = with pkgs; [
# Applications
libreoffice # Office packages
#firefox
chromium
thunderbird
streamlink
streamlink-twitch-gui-bin
element-desktop
intel-gpu-tools
pulsemixer
# Display
light # xorg.xbacklight not supported. Other option is just use xrandr.
# Power Management
#auto-cpufreq # Power management
#tlp # Power management
];
};
programs = {
alacritty.settings.font.size = 11;
};
services = { # Applets
blueman-applet.enable = true; # Bluetooth
network-manager-applet.enable = true; # Network
};
xsession.preferStatusNotifierItems = true;
}