···11+# Do not modify this file! It was generated by ‘nixos-generate-config’
22+# and may be overwritten by future invocations. Please make changes
33+# to /etc/nixos/configuration.nix instead.
44+{
55+ config,
66+ lib,
77+ modulesPath,
88+ pkgs,
99+ ...
1010+}:
1111+1212+{
1313+ imports = [
1414+ (modulesPath + "/installer/scan/not-detected.nix")
1515+ ];
1616+1717+ boot.kernelPackages = pkgs.linuxPackages_latest;
1818+ boot.initrd.availableKernelModules = [
1919+ "nvme"
2020+ "xhci_pci"
2121+ "thunderbolt"
2222+ "usb_storage"
2323+ "usbhid"
2424+ "sd_mod"
2525+ "sdhci_pci"
2626+ ];
2727+ boot.initrd.kernelModules = [
2828+ "kvm-amd"
2929+ "amdgpu"
3030+ "nvme"
3131+ "xhci_pci"
3232+ "thunderbolt"
3333+ "usb_storage"
3434+ "usbhid"
3535+ "sd_mod"
3636+ "sdhci_pci"
3737+ ];
3838+ boot.kernelModules = [
3939+ "kvm-amd"
4040+ "amdgpu"
4141+ "nvme"
4242+ "xhci_pci"
4343+ "thunderbolt"
4444+ "usb_storage"
4545+ "usbhid"
4646+ "sd_mod"
4747+ "sdhci_pci"
4848+ ];
4949+ virtualisation.libvirtd = {
5050+ enable = true;
5151+ qemu = {
5252+ runAsRoot = false;
5353+ };
5454+ };
5555+ #boot.extraModulePackages = with config.boot.kernelPackages; [ ];
5656+ boot.kernelParams = [ ];
5757+5858+ hardware.enableRedistributableFirmware = true;
5959+6060+ fileSystems."/" = {
6161+ device = "/dev/disk/by-uuid/07019c69-2597-410d-a8a0-a8ffb0f58883";
6262+ fsType = "ext4";
6363+ };
6464+6565+ fileSystems."/boot" = {
6666+ device = "/dev/disk/by-uuid/4B85-C90A";
6767+ fsType = "vfat";
6868+ };
6969+7070+ swapDevices = [
7171+ {
7272+ device = "/swapfile";
7373+ size = 32 * 1024;
7474+ }
7575+ ];
7676+7777+ # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
7878+ # (the default) this is the recommended approach. When using systemd-networkd it's
7979+ # still possible to use this option, but it's recommended to use it in conjunction
8080+ # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
8181+ networking.useDHCP = lib.mkDefault true;
8282+ # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
8383+ # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
8484+8585+ nixpkgs.hostPlatform = {
8686+ #gcc.arch = "znver2";
8787+ #gcc.tune = "znver2";
8888+ system = "x86_64-linux";
8989+ #gcc.arch = "x86-64-v3";
9090+ };
9191+ #nix.settings.system-features = ["gccarch-znver2" "big-parallel" "nixos-test" "benchmark" "kvm"];
9292+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
9393+}
+39
host-specific/odin/networking.nix
···11+{ ... }:
22+{
33+ # networking.hostName = "nixos"; # Define your hostname.
44+ # Pick only one of the below networking options.
55+ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
66+ # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
77+ networking.hostName = "odin";
88+ # I like systemd-networkd
99+ systemd.network.enable = true;
1010+ systemd.network.networks."50-wlp2s0" = {
1111+ matchConfig.name = "wlp2s0";
1212+ networkConfig.DHCP = "yes";
1313+ linkConfig.RequiredForOnline = "no";
1414+ };
1515+ networking.useNetworkd = true;
1616+ # TODO: static IP @ 192.168.1.2
1717+1818+ # Configure network proxy if necessary
1919+ # networking.proxy.default = "http://user:password@proxy:port/";
2020+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
2121+ # Open ports in the firewall.
2222+ # networking.firewall.allowedTCPPorts = [ ... ];
2323+ # networking.firewall.allowedUDPPorts = [ ... ];
2424+ # Or disable the firewall altogether.
2525+ # TODO: allow some ports
2626+ networking.firewall.enable = true;
2727+2828+ services.avahi = {
2929+ enable = true;
3030+ nssmdns = true;
3131+ openFirewall = true;
3232+ publish = {
3333+ enable = true;
3434+ addresses = true;
3535+ workstation = true;
3636+ };
3737+ };
3838+3939+}
+98
host-specific/odin/packages.nix
···11+{ pkgs, lib, ... }:
22+let # bash script to let dbus know about important env variables and
33+ # propagate them to relevent services run at the end of sway config
44+ # see
55+ # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist
66+ # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts
77+ # some user services to make sure they have the correct environment variables
88+ dbus-sway-environment = pkgs.writeTextFile {
99+ name = "dbus-sway-environment";
1010+ destination = "/bin/dbus-sway-environment";
1111+ executable = true;
1212+1313+ text = ''
1414+ dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
1515+ systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
1616+ systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
1717+ '';
1818+ };
1919+2020+ # currently, there is some friction between sway and gtk:
2121+ # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
2222+ # the suggested way to set gtk settings is with gsettings
2323+ # for gsettings to work, we need to tell it where the schemas are
2424+ # using the XDG_DATA_DIR environment variable
2525+ # run at the end of sway config
2626+ configure-gtk = pkgs.writeTextFile {
2727+ name = "configure-gtk";
2828+ destination = "/bin/configure-gtk";
2929+ executable = true;
3030+ text =
3131+ let
3232+ # TODO: figure out why these bindings exist or where they're used
3333+ schema = pkgs.gsettings-desktop-schemas;
3434+ datadir = "${schema}/share/gsettings-schemas/${schema.name}";
3535+ in
3636+ ''
3737+ 6 gnome_schema=org.gnome.desktop.interface
3838+ gsettings set $gnome_schema gtk-theme 'Dracula'
3939+ '';
4040+ };
4141+in
4242+{
4343+4444+ # List packages installed in system profile. To search, run:
4545+ # $ nix search wget
4646+ environment.systemPackages = with pkgs; [
4747+ neovim
4848+ appimage-run
4949+ wget
5050+ kitty
5151+ w3m
5252+ fishPlugins.fzf-fish
5353+ fzf
5454+ qemu
5555+ OVMF
5656+5757+ # Sway stuff
5858+ wdisplays
5959+ mako
6060+ bemenu
6161+ wl-clipboard
6262+ slurp
6363+ grim
6464+ swayidle
6565+ swaylock
6666+ gnome3.adwaita-icon-theme
6767+ dracula-theme
6868+ glib
6969+ xdg-utils
7070+ wayland
7171+ configure-gtk
7272+ dbus-sway-environment
7373+ dbus
7474+ ];
7575+7676+ # Fix dynamically linked libraries for unpackaged binaries
7777+ programs.nix-ld = {
7878+ enable = true;
7979+ libraries = with pkgs; [
8080+ # Add missing dynamic libraries for unpackaged programs HERE
8181+ # NOT in environment.systemPackages
8282+ zlib
8383+ ];
8484+ };
8585+8686+ # Logseq uses an ancient version of Electron, so we enable that
8787+ nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
8888+8989+ # Whitelist some unfree packages
9090+ nixpkgs.config.allowUnfreePredicate =
9191+ pkg:
9292+ builtins.elem (lib.getName pkg) [
9393+ "discord"
9494+ "spotify"
9595+ "obsidian"
9696+ "tailscale"
9797+ ];
9898+}
+36
host-specific/odin/services.nix
···11+{ ... }:
22+{
33+ # Some programs need SUID wrappers, can be configured further or are
44+ # started in user sessions.
55+ # programs.mtr.enable = true;
66+ programs.gnupg.agent = {
77+ enable = true;
88+ enableSSHSupport = true;
99+ };
1010+1111+ # Fish shell, the best
1212+ programs.fish.enable = true;
1313+1414+ # List services that you want to enable:
1515+1616+ # Enable the OpenSSH daemon.
1717+ services.openssh.enable = true;
1818+1919+ # This option is for enabling the bolt daemon for managing Thunderbolt/USB4 Devices.
2020+ services.hardware.bolt.enable = true;
2121+2222+ # Tailscale
2323+ services.tailscale = {
2424+ enable = true;
2525+ useRoutingFeatures = "client";
2626+ };
2727+2828+ # Containers and VMs
2929+ virtualisation = {
3030+ podman = {
3131+ enable = true;
3232+ dockerCompat = true;
3333+ defaultNetwork.settings.dns_enabled = true;
3434+ };
3535+ };
3636+}
+3-1
services.nix
···11-{ ... }: {
11+{ ... }:
22+{
33+24 # Some programs need SUID wrappers, can be configured further or are
35 # started in user sessions.
46 programs.mtr.enable = true;