···11-# Edit this configuration file to define what should be installed on
22-## your system. Help is available in the configuration.nix(5) man page, on
33-# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
44-55-{ ... }:
66-77-{
88- imports =
99- [
1010- # Include the results of the hardware scan.
1111- ./hardware-configuration.nix
1212- ./boot.nix
1313- ./networking.nix
1414- ./gui.nix
1515- ./users.nix
1616- ./packages.nix
1717- ./services.nix
1818- ];
1919-2020- # Set your time zone.
2121- time.timeZone = "America/Chicago";
2222-2323- # Select internationalisation properties.
2424- i18n.defaultLocale = "en_US.UTF-8";
2525- # console = {
2626- # font = "Lat2-Terminus16";
2727- # keyMap = "us";
2828- # useXkbConfig = true; # use xkb.options in tty.
2929- # };
3030-3131- # Copy the NixOS configuration file and link it from the resulting system
3232- # (/run/current-system/configuration.nix). This is useful in case you
3333- # accidentally delete configuration.nix.
3434- system.copySystemConfiguration = true;
3535-3636- # Automatic doc cache generation
3737- documentation.man.generateCaches = true;
3838-3939- # Automatic system upgrades
4040- system.autoUpgrade = {
4141- enable = true;
4242- dates = "09:00";
4343- randomizedDelaySec = "45min";
4444- };
4545-4646- # Automatic Garbage Collection
4747- nix.gc.automatic = true;
4848- nix.gc.options = "--delete-older-than 8d";
4949-5050- # This option defines the first version of NixOS you have installed on this particular machine,
5151- # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
5252- #
5353- # Most users should NEVER change this value after the initial install, for any reason,
5454- # even if you've upgraded your system to a new NixOS release.
5555- #
5656- # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
5757- # so changing it will NOT upgrade your system.
5858- #
5959- # This value being lower than the current NixOS release does NOT mean your system is
6060- # out of date, out of support, or vulnerable.
6161- #
6262- # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
6363- # and migrated your data accordingly.
6464- #
6565- # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
6666- system.stateVersion = "23.11"; # Did you read the comment?
6767-6868-}
-15
default.nix
···11-let
22- nix-pre-commit-hooks = import (builtins.fetchTarball "https://github.com/cachix/pre-commit-hooks.nix/tarball/master");
33-in
44-{
55- # Configured with the module options defined in `modules/pre-commit.nix`:
66- pre-commit-check = nix-pre-commit-hooks.run {
77- src = ./.;
88- # If your hooks are intrusive, avoid running on each commit with a default_states like this:
99- # default_stages = ["manual" "push"];
1010- hooks = {
1111- nixpkgs-fmt.enable = true;
1212- nil.enable = true;
1313- };
1414- };
1515-}
+5-5
fish/config.fish
···1717abbr gd "git diff"
1818abbr ga "git add"
1919abbr glog "git log –graph –decorate –oneline –all"
2020-if type -q "emanote"
2121- abbr n "cd ~/repos/notes"
2222- abbr ne "cd ~/repos/notes; nvim"
2323-end
24202521abbr srhtclone "git clone git@git.sr.ht:~chiefnoah/"
2622abbr ghclone "git clone git@github.com:chiefnoah/"
27232828-if test -d "~/repos"
2424+if test -d "$HOME/repos"
2925 alias r "cd ~/repos"
2626+end
2727+2828+if test -d "$HOME/repos/ambient"
2929+ alias amb "cd ~/repos/ambient"
3030end
31313232# PATH stuff
···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- file
5252- w3m
5353- fishPlugins.fzf-fish
5454- fzf
5555- qemu
5656- OVMF
5757- #9p stuff
5858- diod
5959- plan9port
6060- vis
6161- rc
6262-6363- # Sway stuff
6464- wdisplays
6565- mako
6666- bemenu
6767- wl-clipboard
6868- slurp
6969- grim
7070- swayidle
7171- swaylock
7272- adwaita-icon-theme
7373- dracula-theme
7474- glib
7575- xdg-utils
7676- wayland
7777- configure-gtk
7878- dbus-sway-environment
7979- dbus
8080- pkg-config
8181- zlib
8282- # why wouldn't I want documentation on my system
8383- man-pages
8484- man-pages-posix
8585- ];
8686- documentation.dev.enable = true;
8787-8888- # Fix dynamically linked libraries for unpackaged binaries
8989- programs.nix-ld = {
9090- enable = true;
9191- libraries = with pkgs; [
9292- # Add missing dynamic libraries for unpackaged programs HERE
9393- # NOT in environment.systemPackages
9494- zlib
9595- openssl
9696- sqlite
9797- libunwind
9898- libglvnd
9999- ];
100100- };
101101-102102-103103- # Logseq uses an ancient version of Electron, so we enable that
104104- nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
105105-106106- # Whitelist some unfree packages
107107- nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
108108- "discord"
109109- "spotify"
110110- "obsidian"
111111- "unstable.obsidian"
112112- "tailscale"
113113- "google-chrome"
114114- ];
115115-}
-39
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- # Smart Card daemon
2020- services.pcscd.enable = true;
2121-2222- # This option is for enabling the bolt daemon for managing Thunderbolt/USB4 Devices.
2323- services.hardware.bolt.enable = true;
2424-2525- # Tailscale
2626- services.tailscale = {
2727- enable = true;
2828- useRoutingFeatures = "client";
2929- };
3030-3131- # Containers and VMs
3232- virtualisation = {
3333- podman = {
3434- enable = true;
3535- dockerCompat = true;
3636- defaultNetwork.settings.dns_enabled = true;
3737- };
3838- };
3939-}
···11-AddKeysToAgent yes
21ServerAliveInterval 60
33-ForwardAgent no
42ControlMaster auto
53ControlPath ~/.ssh/master-%r@%h:%p
64
-42
users.nix
···11-{ pkgs, ... }:
22-let
33- home-manager = builtins.fetchTarball
44- "https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz";
55-in
66-{
77-88- imports = [
99- # Import home-manager first, it's required for other modules
1010- (import "${home-manager}/nixos")
1111- ];
1212-1313- # Declarative only optoins.
1414- # I don't want to allow ad-hoc modifying users on the system.
1515- # Users must be declared either as part of a package or in this file.
1616- users.mutableUsers = false;
1717-1818-1919- # Define a user account. Don't forget to set a password with ‘passwd’.
2020- users.users.noah = {
2121- isNormalUser = true;
2222- shell = pkgs.fish;
2323- extraGroups = [ "wheel" "video" "nas" "libvirtd" "qemu-libvirtd" ]; # Enable ‘sudo’ for the user.
2424- hashedPasswordFile = "/etc/nixos/noah-password";
2525- openssh.authorizedKeys.keys = [
2626- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC/cXL1cV6QUW5z2bJp1mCu0CXrcc0Dntdxaeo3fg60N noah@odin"
2727- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJeSPXmzD0rXKNjR1q+qSJqXjO0gxLitTRD+m02v94p6 noah@aleister"
2828- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDQFlX3hhXxsqAUYLvF+IX1YWQ+k22OHlqMOjgyNBe9e noah@misaki"
2929- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMFOUuNyxdcMRmDiqQMxNZX1CFiJye5JbHIJ95fXd5dC noah@nixos-wsl"
3030- ];
3131- };
3232-3333- users.groups.nas.gid = 1001;
3434-3535- # I manage my home with home-manager
3636- # Don't store packages in ~/.nix-profile, use /etc/profiles so we can build-vm
3737- home-manager.useUserPackages = true;
3838- # No more NIX_PATH, use system pkgs
3939- home-manager.useGlobalPkgs = true;
4040-4141- home-manager.users.noah = import ./noah-home.nix;
4242-}