From e6edbad14d8255743c7b259a1985db5fb5bd4e91 Mon Sep 17 00:00:00 2001 From: jjanzen Date: Wed, 5 Mar 2025 22:17:31 -0600 Subject: system changes --- Makefile | 2 +- macos.local/.flake/flake.lock | 69 ------------ macos.local/.flake/flake.nix.org | 34 ------ macos.local/.flake/home/.wallpaper | 1 - macos.local/.flake/home/clang-format.nix.org | 1 - macos.local/.flake/home/core.nix.org | 30 ------ macos.local/.flake/home/fonts.nix.org | 1 - macos.local/.flake/home/programs/.DS_Store | Bin 6148 -> 0 bytes macos.local/.flake/home/programs/core.nix.org | 68 ------------ .../.flake/home/programs/emacs/core.nix.org | 14 --- .../.flake/home/programs/emacs/early-init.el.org | 1 - .../.flake/home/programs/emacs/feed.org.org | 1 - macos.local/.flake/home/programs/emacs/init.el.org | 1 - macos.local/.flake/home/programs/fastfetch.nix.org | 1 - macos.local/.flake/home/programs/ghostty.nix.org | 23 ---- macos.local/.flake/home/programs/git.nix.org | 1 - macos.local/.flake/home/programs/ncmpcpp.nix.org | 28 ----- macos.local/.flake/home/programs/neovim.nix.org | 1 - macos.local/.flake/home/programs/ssh.nix.org | 44 -------- macos.local/.flake/home/programs/zsh/core.nix.org | 36 ------- .../.flake/home/programs/zsh/init-extra.sh.org | 28 ----- .../.flake/home/programs/zsh/profile-extra.sh.org | 10 -- macos.local/.flake/home/scripts/core.nix.org | 27 ----- macos.local/.flake/home/scripts/deploy-website.org | 7 -- macos.local/.flake/home/scripts/launcher.org | 7 -- macos.local/.flake/home/scripts/manage-system.org | 47 -------- .../.flake/home/scripts/remove-quarantine.org | 7 -- macos.local/.flake/home/services/core.nix.org | 12 --- macos.local/.flake/home/services/mpd.nix.org | 49 --------- macos.local/.flake/system/aerospace.nix.org | 96 ----------------- macos.local/.flake/system/core.nix.org | 61 ----------- macos.local/.flake/system/homebrew.nix.org | 118 --------------------- macos.local/flake/flake.lock | 69 ++++++++++++ macos.local/flake/flake.nix.org | 34 ++++++ macos.local/flake/home/.wallpaper | 1 + macos.local/flake/home/clang-format.nix.org | 1 + macos.local/flake/home/core.nix.org | 30 ++++++ macos.local/flake/home/fonts.nix.org | 1 + macos.local/flake/home/programs/.DS_Store | Bin 0 -> 6148 bytes macos.local/flake/home/programs/core.nix.org | 68 ++++++++++++ macos.local/flake/home/programs/emacs/core.nix.org | 14 +++ .../flake/home/programs/emacs/early-init.el.org | 1 + macos.local/flake/home/programs/emacs/feed.org.org | 1 + macos.local/flake/home/programs/emacs/init.el.org | 1 + macos.local/flake/home/programs/fastfetch.nix.org | 1 + macos.local/flake/home/programs/ghostty.nix.org | 23 ++++ macos.local/flake/home/programs/git.nix.org | 1 + macos.local/flake/home/programs/ncmpcpp.nix.org | 28 +++++ macos.local/flake/home/programs/neovim.nix.org | 1 + macos.local/flake/home/programs/ssh.nix.org | 44 ++++++++ macos.local/flake/home/programs/zsh/core.nix.org | 36 +++++++ .../flake/home/programs/zsh/init-extra.sh.org | 28 +++++ .../flake/home/programs/zsh/profile-extra.sh.org | 10 ++ macos.local/flake/home/scripts/core.nix.org | 27 +++++ macos.local/flake/home/scripts/deploy-website.org | 7 ++ macos.local/flake/home/scripts/launcher.org | 7 ++ macos.local/flake/home/scripts/manage-system.org | 47 ++++++++ .../flake/home/scripts/remove-quarantine.org | 7 ++ macos.local/flake/home/services/core.nix.org | 12 +++ macos.local/flake/home/services/mpd.nix.org | 49 +++++++++ macos.local/flake/system/aerospace.nix.org | 96 +++++++++++++++++ macos.local/flake/system/core.nix.org | 61 +++++++++++ macos.local/flake/system/homebrew.nix.org | 118 +++++++++++++++++++++ nixos/.flake/flake.lock | 61 ----------- nixos/.flake/flake.nix.org | 34 ------ nixos/.flake/home/.wallpaper | 1 - nixos/.flake/home/clang-format.nix.org | 1 - nixos/.flake/home/core.nix.org | 25 ----- nixos/.flake/home/cursor.nix.org | 1 - nixos/.flake/home/fonts.nix.org | 1 - nixos/.flake/home/hyprland.nix.org | 1 - nixos/.flake/home/programs/core.nix.org | 52 --------- nixos/.flake/home/programs/emacs | 1 - nixos/.flake/home/programs/fastfetch.nix.org | 1 - nixos/.flake/home/programs/foot.nix.org | 1 - nixos/.flake/home/programs/git.nix.org | 1 - nixos/.flake/home/programs/hyprlock.nix.org | 1 - nixos/.flake/home/programs/ncmpcpp.nix.org | 1 - nixos/.flake/home/programs/neovim.nix.org | 1 - nixos/.flake/home/programs/ssh.nix.org | 1 - nixos/.flake/home/programs/waybar.nix.org | 1 - nixos/.flake/home/programs/zsh.nix.org | 1 - nixos/.flake/home/scripts.nix.org | 43 -------- nixos/.flake/home/services/core.nix.org | 19 ---- nixos/.flake/home/services/emacs.nix.org | 1 - nixos/.flake/home/services/mako.nix.org | 1 - nixos/.flake/home/services/mpd.nix.org | 1 - nixos/.flake/home/services/syncthing.nix.org | 1 - nixos/.flake/system/boot.nix.org | 11 -- nixos/.flake/system/core.nix.org | 21 ---- nixos/.flake/system/desktop.nix.org | 116 -------------------- nixos/.flake/system/hardware-configuration.nix | 41 ------- nixos/.flake/system/locale.nix.org | 11 -- nixos/.flake/system/network.nix.org | 55 ---------- nixos/.flake/system/update-resolv-conf.sh | 71 ------------- nixos/.flake/system/users.nix.org | 14 --- nixos/flake/flake.lock | 61 +++++++++++ nixos/flake/flake.nix.org | 34 ++++++ nixos/flake/home/.wallpaper | 1 + nixos/flake/home/clang-format.nix.org | 1 + nixos/flake/home/core.nix.org | 25 +++++ nixos/flake/home/cursor.nix.org | 1 + nixos/flake/home/fonts.nix.org | 1 + nixos/flake/home/hyprland.nix.org | 1 + nixos/flake/home/programs/core.nix.org | 52 +++++++++ nixos/flake/home/programs/emacs | 1 + nixos/flake/home/programs/fastfetch.nix.org | 1 + nixos/flake/home/programs/foot.nix.org | 1 + nixos/flake/home/programs/git.nix.org | 1 + nixos/flake/home/programs/hyprlock.nix.org | 1 + nixos/flake/home/programs/ncmpcpp.nix.org | 1 + nixos/flake/home/programs/neovim.nix.org | 1 + nixos/flake/home/programs/ssh.nix.org | 1 + nixos/flake/home/programs/waybar.nix.org | 1 + nixos/flake/home/programs/zsh.nix.org | 1 + nixos/flake/home/scripts.nix.org | 43 ++++++++ nixos/flake/home/services/core.nix.org | 19 ++++ nixos/flake/home/services/emacs.nix.org | 1 + nixos/flake/home/services/mako.nix.org | 1 + nixos/flake/home/services/mpd.nix.org | 1 + nixos/flake/home/services/syncthing.nix.org | 1 + nixos/flake/system/boot.nix.org | 11 ++ nixos/flake/system/core.nix.org | 21 ++++ nixos/flake/system/desktop.nix.org | 116 ++++++++++++++++++++ nixos/flake/system/hardware-configuration.nix | 41 +++++++ nixos/flake/system/locale.nix.org | 11 ++ nixos/flake/system/network.nix.org | 55 ++++++++++ nixos/flake/system/update-resolv-conf.sh | 71 +++++++++++++ nixos/flake/system/users.nix.org | 14 +++ 129 files changed, 1418 insertions(+), 1418 deletions(-) delete mode 100644 macos.local/.flake/flake.lock delete mode 100644 macos.local/.flake/flake.nix.org delete mode 120000 macos.local/.flake/home/.wallpaper delete mode 120000 macos.local/.flake/home/clang-format.nix.org delete mode 100644 macos.local/.flake/home/core.nix.org delete mode 120000 macos.local/.flake/home/fonts.nix.org delete mode 100644 macos.local/.flake/home/programs/.DS_Store delete mode 100644 macos.local/.flake/home/programs/core.nix.org delete mode 100644 macos.local/.flake/home/programs/emacs/core.nix.org delete mode 120000 macos.local/.flake/home/programs/emacs/early-init.el.org delete mode 120000 macos.local/.flake/home/programs/emacs/feed.org.org delete mode 120000 macos.local/.flake/home/programs/emacs/init.el.org delete mode 120000 macos.local/.flake/home/programs/fastfetch.nix.org delete mode 100644 macos.local/.flake/home/programs/ghostty.nix.org delete mode 120000 macos.local/.flake/home/programs/git.nix.org delete mode 100644 macos.local/.flake/home/programs/ncmpcpp.nix.org delete mode 120000 macos.local/.flake/home/programs/neovim.nix.org delete mode 100644 macos.local/.flake/home/programs/ssh.nix.org delete mode 100644 macos.local/.flake/home/programs/zsh/core.nix.org delete mode 100644 macos.local/.flake/home/programs/zsh/init-extra.sh.org delete mode 100644 macos.local/.flake/home/programs/zsh/profile-extra.sh.org delete mode 100644 macos.local/.flake/home/scripts/core.nix.org delete mode 100644 macos.local/.flake/home/scripts/deploy-website.org delete mode 100644 macos.local/.flake/home/scripts/launcher.org delete mode 100644 macos.local/.flake/home/scripts/manage-system.org delete mode 100644 macos.local/.flake/home/scripts/remove-quarantine.org delete mode 100644 macos.local/.flake/home/services/core.nix.org delete mode 100644 macos.local/.flake/home/services/mpd.nix.org delete mode 100644 macos.local/.flake/system/aerospace.nix.org delete mode 100644 macos.local/.flake/system/core.nix.org delete mode 100644 macos.local/.flake/system/homebrew.nix.org create mode 100644 macos.local/flake/flake.lock create mode 100644 macos.local/flake/flake.nix.org create mode 120000 macos.local/flake/home/.wallpaper create mode 120000 macos.local/flake/home/clang-format.nix.org create mode 100644 macos.local/flake/home/core.nix.org create mode 120000 macos.local/flake/home/fonts.nix.org create mode 100644 macos.local/flake/home/programs/.DS_Store create mode 100644 macos.local/flake/home/programs/core.nix.org create mode 100644 macos.local/flake/home/programs/emacs/core.nix.org create mode 120000 macos.local/flake/home/programs/emacs/early-init.el.org create mode 120000 macos.local/flake/home/programs/emacs/feed.org.org create mode 120000 macos.local/flake/home/programs/emacs/init.el.org create mode 120000 macos.local/flake/home/programs/fastfetch.nix.org create mode 100644 macos.local/flake/home/programs/ghostty.nix.org create mode 120000 macos.local/flake/home/programs/git.nix.org create mode 100644 macos.local/flake/home/programs/ncmpcpp.nix.org create mode 120000 macos.local/flake/home/programs/neovim.nix.org create mode 100644 macos.local/flake/home/programs/ssh.nix.org create mode 100644 macos.local/flake/home/programs/zsh/core.nix.org create mode 100644 macos.local/flake/home/programs/zsh/init-extra.sh.org create mode 100644 macos.local/flake/home/programs/zsh/profile-extra.sh.org create mode 100644 macos.local/flake/home/scripts/core.nix.org create mode 100644 macos.local/flake/home/scripts/deploy-website.org create mode 100644 macos.local/flake/home/scripts/launcher.org create mode 100644 macos.local/flake/home/scripts/manage-system.org create mode 100644 macos.local/flake/home/scripts/remove-quarantine.org create mode 100644 macos.local/flake/home/services/core.nix.org create mode 100644 macos.local/flake/home/services/mpd.nix.org create mode 100644 macos.local/flake/system/aerospace.nix.org create mode 100644 macos.local/flake/system/core.nix.org create mode 100644 macos.local/flake/system/homebrew.nix.org delete mode 100644 nixos/.flake/flake.lock delete mode 100644 nixos/.flake/flake.nix.org delete mode 120000 nixos/.flake/home/.wallpaper delete mode 120000 nixos/.flake/home/clang-format.nix.org delete mode 100644 nixos/.flake/home/core.nix.org delete mode 120000 nixos/.flake/home/cursor.nix.org delete mode 120000 nixos/.flake/home/fonts.nix.org delete mode 120000 nixos/.flake/home/hyprland.nix.org delete mode 100644 nixos/.flake/home/programs/core.nix.org delete mode 120000 nixos/.flake/home/programs/emacs delete mode 120000 nixos/.flake/home/programs/fastfetch.nix.org delete mode 120000 nixos/.flake/home/programs/foot.nix.org delete mode 120000 nixos/.flake/home/programs/git.nix.org delete mode 120000 nixos/.flake/home/programs/hyprlock.nix.org delete mode 120000 nixos/.flake/home/programs/ncmpcpp.nix.org delete mode 120000 nixos/.flake/home/programs/neovim.nix.org delete mode 120000 nixos/.flake/home/programs/ssh.nix.org delete mode 120000 nixos/.flake/home/programs/waybar.nix.org delete mode 120000 nixos/.flake/home/programs/zsh.nix.org delete mode 100644 nixos/.flake/home/scripts.nix.org delete mode 100644 nixos/.flake/home/services/core.nix.org delete mode 120000 nixos/.flake/home/services/emacs.nix.org delete mode 120000 nixos/.flake/home/services/mako.nix.org delete mode 120000 nixos/.flake/home/services/mpd.nix.org delete mode 120000 nixos/.flake/home/services/syncthing.nix.org delete mode 100644 nixos/.flake/system/boot.nix.org delete mode 100644 nixos/.flake/system/core.nix.org delete mode 100644 nixos/.flake/system/desktop.nix.org delete mode 100644 nixos/.flake/system/hardware-configuration.nix delete mode 100644 nixos/.flake/system/locale.nix.org delete mode 100644 nixos/.flake/system/network.nix.org delete mode 100644 nixos/.flake/system/update-resolv-conf.sh delete mode 100644 nixos/.flake/system/users.nix.org create mode 100644 nixos/flake/flake.lock create mode 100644 nixos/flake/flake.nix.org create mode 120000 nixos/flake/home/.wallpaper create mode 120000 nixos/flake/home/clang-format.nix.org create mode 100644 nixos/flake/home/core.nix.org create mode 120000 nixos/flake/home/cursor.nix.org create mode 120000 nixos/flake/home/fonts.nix.org create mode 120000 nixos/flake/home/hyprland.nix.org create mode 100644 nixos/flake/home/programs/core.nix.org create mode 120000 nixos/flake/home/programs/emacs create mode 120000 nixos/flake/home/programs/fastfetch.nix.org create mode 120000 nixos/flake/home/programs/foot.nix.org create mode 120000 nixos/flake/home/programs/git.nix.org create mode 120000 nixos/flake/home/programs/hyprlock.nix.org create mode 120000 nixos/flake/home/programs/ncmpcpp.nix.org create mode 120000 nixos/flake/home/programs/neovim.nix.org create mode 120000 nixos/flake/home/programs/ssh.nix.org create mode 120000 nixos/flake/home/programs/waybar.nix.org create mode 120000 nixos/flake/home/programs/zsh.nix.org create mode 100644 nixos/flake/home/scripts.nix.org create mode 100644 nixos/flake/home/services/core.nix.org create mode 120000 nixos/flake/home/services/emacs.nix.org create mode 120000 nixos/flake/home/services/mako.nix.org create mode 120000 nixos/flake/home/services/mpd.nix.org create mode 120000 nixos/flake/home/services/syncthing.nix.org create mode 100644 nixos/flake/system/boot.nix.org create mode 100644 nixos/flake/system/core.nix.org create mode 100644 nixos/flake/system/desktop.nix.org create mode 100644 nixos/flake/system/hardware-configuration.nix create mode 100644 nixos/flake/system/locale.nix.org create mode 100644 nixos/flake/system/network.nix.org create mode 100644 nixos/flake/system/update-resolv-conf.sh create mode 100644 nixos/flake/system/users.nix.org diff --git a/Makefile b/Makefile index 40cd748..3e88b82 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ endif # update by default, install first all: update update: install $(UPDATE_TARGET) - cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/.flake + cp $(DSTDIR)/.flake/flake.lock $(SRCDIR)/flake git add -A git commit -m "update lock file" || true diff --git a/macos.local/.flake/flake.lock b/macos.local/.flake/flake.lock deleted file mode 100644 index 16fab9e..0000000 --- a/macos.local/.flake/flake.lock +++ /dev/null @@ -1,69 +0,0 @@ -{ - "nodes": { - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1741128660, - "narHash": "sha256-GWaZ+KGxWYbOB15CSqktwngq0ccA1l2Ov3aUfl9jeY4=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "b1b964ea9348aef08cab514fa88e9c99def6fd63", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1741112248, - "narHash": "sha256-Y340xoE1Vgo0eCDJi4srVjuwlr50vYSoyJrZeXHw3n0=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "991bb2f6d46fc2ff7990913c173afdb0318314cb", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1741037377, - "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "02032da4af073d0f6110540c8677f16d4be0117f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/macos.local/.flake/flake.nix.org b/macos.local/.flake/flake.nix.org deleted file mode 100644 index 9a07ccb..0000000 --- a/macos.local/.flake/flake.nix.org +++ /dev/null @@ -1,34 +0,0 @@ -#+title: macOS Nix Configuration - -The root for my macOS nix configuration using flake and home-manager. -#+begin_src nix - { - description = "My Darwin Configuration"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - nix-darwin.url = "github:LnL7/nix-darwin"; - nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - }; - - outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager }: { - darwinConfigurations."macos" = nix-darwin.lib.darwinSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./system/core.nix - home-manager.darwinModules.home-manager - { - home-manager.backupFileExtension = "bak"; - home-manager.useGlobalPkgs = false; - home-manager.useUserPackages = true; - home-manager.users.jjanzen = import ./home/core.nix; - } - ]; - }; - - darwinPackages = self.darwinConfigurations."macos".pkgs; - }; - } -#+end_src diff --git a/macos.local/.flake/home/.wallpaper b/macos.local/.flake/home/.wallpaper deleted file mode 120000 index 316db81..0000000 --- a/macos.local/.flake/home/.wallpaper +++ /dev/null @@ -1 +0,0 @@ -../../../common/.wallpaper \ No newline at end of file diff --git a/macos.local/.flake/home/clang-format.nix.org b/macos.local/.flake/home/clang-format.nix.org deleted file mode 120000 index db7166a..0000000 --- a/macos.local/.flake/home/clang-format.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../common/.flake/home/clang-format.nix.org \ No newline at end of file diff --git a/macos.local/.flake/home/core.nix.org b/macos.local/.flake/home/core.nix.org deleted file mode 100644 index cb2b34d..0000000 --- a/macos.local/.flake/home/core.nix.org +++ /dev/null @@ -1,30 +0,0 @@ -#+title: Home Configuration - -Set up home manager for my user account and import submodules. Define my user as =jjanzen= and specify the wallpaper and add items to the =PATH= variable. -#+begin_src nix - { config, pkgs, ... }: - - { - imports = [ - ./clang-format.nix - ./fonts.nix - ./programs/core.nix - ./scripts/core.nix - ./services/core.nix - ]; - - home.stateVersion = "24.05"; - programs.home-manager.enable = true; - - home.username = "jjanzen"; - home.homeDirectory = "/Users/jjanzen"; - - home.file.".wallpaper".source = ./.wallpaper; - - home.sessionPath = [ - "$HOME/.local/bin" - "/usr/local/bin" - "/opt/homebrew/bin" - ]; - } -#+end_src diff --git a/macos.local/.flake/home/fonts.nix.org b/macos.local/.flake/home/fonts.nix.org deleted file mode 120000 index 53bec1c..0000000 --- a/macos.local/.flake/home/fonts.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../common/.flake/home/fonts.nix.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/.DS_Store b/macos.local/.flake/home/programs/.DS_Store deleted file mode 100644 index 668825b..0000000 Binary files a/macos.local/.flake/home/programs/.DS_Store and /dev/null differ diff --git a/macos.local/.flake/home/programs/core.nix.org b/macos.local/.flake/home/programs/core.nix.org deleted file mode 100644 index 24b2555..0000000 --- a/macos.local/.flake/home/programs/core.nix.org +++ /dev/null @@ -1,68 +0,0 @@ -#+title: Core Program Configuration - -Import configurations for programs and install programs with no configuration. -#+begin_src nix - { config, pkgs, ... }: - - { - imports = [ - ./emacs/core.nix - ./fastfetch.nix - ./ghostty.nix - ./git.nix - ./ncmpcpp.nix - ./neovim.nix - ./ssh.nix - ./zsh/core.nix - ]; - - home.packages = with pkgs; [ - aescrypt - bash-language-server - bear - bison - cmake - cmake-language-server - curl - dos2unix - eza - ffmpeg - fzf - gnutls - go - gopls - gpgme - htop - hunspell - hyfetch # TODO: configure - inetutils - ispell - lesspipe - marksman - mailutils - meson - mpv - ninja - nodejs_23 - notcurses - p7zip - pandoc - python312 - python312Packages.black - python312Packages.pylint - python312Packages.python-lsp-server - ripgrep - rsync - rustup - shellcheck - shfmt - texliveFull - typescript-language-server - vscode-langservers-extracted - wget - yt-dlp - zig - zls - ]; - } -#+end_src diff --git a/macos.local/.flake/home/programs/emacs/core.nix.org b/macos.local/.flake/home/programs/emacs/core.nix.org deleted file mode 100644 index 2bb4237..0000000 --- a/macos.local/.flake/home/programs/emacs/core.nix.org +++ /dev/null @@ -1,14 +0,0 @@ -#+title: Emacs Configuration - -Here is my Emacs configuration. This file just defines configurations that should exist. Emacs is installed with Homebrew. -#+begin_src nix - { config, pkgs, ... }: - - { - home.file = { - "./.config/emacs/early-init.el".source = ./early-init.el; - "./.config/emacs/feed.org".source = ./feed.org; - "./.config/emacs/init.el".source = ./init.el; - }; - } -#+end_src diff --git a/macos.local/.flake/home/programs/emacs/early-init.el.org b/macos.local/.flake/home/programs/emacs/early-init.el.org deleted file mode 120000 index 7c20436..0000000 --- a/macos.local/.flake/home/programs/emacs/early-init.el.org +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/.config/emacs/early-init.el.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/emacs/feed.org.org b/macos.local/.flake/home/programs/emacs/feed.org.org deleted file mode 120000 index d074855..0000000 --- a/macos.local/.flake/home/programs/emacs/feed.org.org +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/.config/emacs/feed.org.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/emacs/init.el.org b/macos.local/.flake/home/programs/emacs/init.el.org deleted file mode 120000 index 6b2f721..0000000 --- a/macos.local/.flake/home/programs/emacs/init.el.org +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/.config/emacs/init.el.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/fastfetch.nix.org b/macos.local/.flake/home/programs/fastfetch.nix.org deleted file mode 120000 index 25e2716..0000000 --- a/macos.local/.flake/home/programs/fastfetch.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/fastfetch.nix.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/ghostty.nix.org b/macos.local/.flake/home/programs/ghostty.nix.org deleted file mode 100644 index 29bc15a..0000000 --- a/macos.local/.flake/home/programs/ghostty.nix.org +++ /dev/null @@ -1,23 +0,0 @@ -#+title: ghostty Configuration - -I use =ghostty= as a terminal emulator on macOS. I disable auto-update and set some sensible options. -#+begin_src nix - { config, pkgs, ... }: - - { - home.file."./.config/ghostty/config".text = '' - auto-update = "off" - background-blur-radius = 20 - background-opacity = 0.8 - clipboard-trim-trailing-spaces = true - font-family = "SauceCodePro Nerd Font" - font-thicken = true - macos-option-as-alt = true - macos-window-shadow = false - mouse-hide-while-typing = true - quit-after-last-window-closed = true - theme = "Builtin Light" - window-decoration = true - ''; - } -#+end_src diff --git a/macos.local/.flake/home/programs/git.nix.org b/macos.local/.flake/home/programs/git.nix.org deleted file mode 120000 index e8ddd28..0000000 --- a/macos.local/.flake/home/programs/git.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/git.nix.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/ncmpcpp.nix.org b/macos.local/.flake/home/programs/ncmpcpp.nix.org deleted file mode 100644 index 6c697ef..0000000 --- a/macos.local/.flake/home/programs/ncmpcpp.nix.org +++ /dev/null @@ -1,28 +0,0 @@ -#+title: =ncmpcpp= Configuration - -Enable =vi=-like controls and specify directories and =mpd= address. -#+begin_src nix - { config, pkgs, ... }: - - { - programs.ncmpcpp = { - enable = true; - bindings = [ - { key = "j"; command = "scroll_down"; } - { key = "k"; command = "scroll_up"; } - { key = "h"; command = "previous_column"; } - { key = "l"; command = "next_column"; } - { key = "g"; command = "move_home"; } - { key = "G"; command = "move_end"; } - { key = "n"; command = "next_found_item"; } - { key = "N"; command = "previous_found_item"; } - ]; - mpdMusicDir = "/Volumes/Media/Music"; - settings = { - ncmpcpp_directory = "~/.config/nmcpcpp"; - mpd_host = "localhost"; - mpd_port = "6600"; - }; - }; - } -#+end_src diff --git a/macos.local/.flake/home/programs/neovim.nix.org b/macos.local/.flake/home/programs/neovim.nix.org deleted file mode 120000 index 871eafa..0000000 --- a/macos.local/.flake/home/programs/neovim.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/neovim.nix.org \ No newline at end of file diff --git a/macos.local/.flake/home/programs/ssh.nix.org b/macos.local/.flake/home/programs/ssh.nix.org deleted file mode 100644 index 28f779f..0000000 --- a/macos.local/.flake/home/programs/ssh.nix.org +++ /dev/null @@ -1,44 +0,0 @@ -#+title: SSH Configuration - -Configure SSH. Keys should be added to the SSH agent. Use the system keychain on all configurations. -#+begin_src nix - { config, pkgs, ... }: - { - programs.ssh = { - enable = true; - addKeysToAgent = "yes"; - matchBlocks = { - "*" = { - identityFile = "~/.ssh/id_ed25519"; - extraOptions = { - "UseKeychain" = "yes"; - }; - }; - - "aviary" = { - hostname = "aviary.cs.umanitoba.ca"; - user = "janzenj2"; - setEnv = { - "TERM" = "xterm"; - }; - }; - - "jjanzen.ca" = { - setEnv = { - "TERM" = "xterm"; - }; - }; - - "oracle" = { - setEnv = { - "TERM" = "xterm"; - }; - hostname = "jjanzen.ca"; - identityFile = "~/.ssh/oracle"; - identitiesOnly = true; - user = "opc"; - }; - }; - }; - } -#+end_src diff --git a/macos.local/.flake/home/programs/zsh/core.nix.org b/macos.local/.flake/home/programs/zsh/core.nix.org deleted file mode 100644 index 84e9aff..0000000 --- a/macos.local/.flake/home/programs/zsh/core.nix.org +++ /dev/null @@ -1,36 +0,0 @@ -#+title: ZSH Configuration - -Open =zsh= configuration. -#+begin_src nix - { config, pkgs, ... }: - - { - programs.zsh = { - enable = true; - - autocd = true; - - autosuggestion.enable = true; - - defaultKeymap = "emacs"; - - history = { - append = true; - ignoreAllDups = true; - }; - - shellAliases = { - "ll" = "ls -alF"; - "la" = "ls -a"; - "l" = "ls -F"; - "sl" = "ls"; - }; - - syntaxHighlighting.enable = true; - - initExtra = builtins.readFile ./init-extra.sh; - - profileExtra = builtins.readFile ./profile-extra.sh; - }; - } -#+end_src diff --git a/macos.local/.flake/home/programs/zsh/init-extra.sh.org b/macos.local/.flake/home/programs/zsh/init-extra.sh.org deleted file mode 100644 index 8255ce1..0000000 --- a/macos.local/.flake/home/programs/zsh/init-extra.sh.org +++ /dev/null @@ -1,28 +0,0 @@ -#+title: ZSH Extra Initialization Code - -Define optional aliases. -#+begin_src sh - which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" - which eza &> /dev/null && alias ls=eza -#+end_src - -Enable =fzf= extensions for =zsh=. -#+begin_src sh - which zsh &> /dev/null && source <(fzf --zsh) -#+end_src - -Enable git status in =zsh= prompt. -#+begin_src sh - parse_git_dirty() { - git_status="$(git status 2> /dev/null)" - [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" - [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" - [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" - [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" - } - setopt prompt_subst - autoload -Uz vcs_info - precmd () { vcs_info } - zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) - PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' -#+end_src diff --git a/macos.local/.flake/home/programs/zsh/profile-extra.sh.org b/macos.local/.flake/home/programs/zsh/profile-extra.sh.org deleted file mode 100644 index 64457ed..0000000 --- a/macos.local/.flake/home/programs/zsh/profile-extra.sh.org +++ /dev/null @@ -1,10 +0,0 @@ -#+title: Profile Extra Code - -Enable =ssh-agent= at login. -#+begin_src sh - if [ ! -S ~/.ssh/ssh_auth_sock ]; then - eval `ssh-agent` > /dev/null - ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock - fi - export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock -#+end_src diff --git a/macos.local/.flake/home/scripts/core.nix.org b/macos.local/.flake/home/scripts/core.nix.org deleted file mode 100644 index f3fd314..0000000 --- a/macos.local/.flake/home/scripts/core.nix.org +++ /dev/null @@ -1,27 +0,0 @@ -#+title: Custom Scripts - -Import various scripts useful on my system. -#+begin_src nix - { config, pkgs, ... }: - - { - home.file = { - "./.local/bin/deploy-website" = { - executable = true; - source = ./deploy-website; - }; - "./.local/bin/launcher" = { - executable = true; - source = ./launcher; - }; - "./.local/bin/remove-quarantine" = { - executable = true; - source = ./remove-quarantine; - }; - "./.local/bin/manage-system" = { - executable = true; - source = ./manage-system; - }; - }; - } -#+end_src diff --git a/macos.local/.flake/home/scripts/deploy-website.org b/macos.local/.flake/home/scripts/deploy-website.org deleted file mode 100644 index 76e5d54..0000000 --- a/macos.local/.flake/home/scripts/deploy-website.org +++ /dev/null @@ -1,7 +0,0 @@ -#+title: Website Deploy Script - -Deploy my website from a specified branch by using =ssh= to get into my server and running the deploy script, passing command line arguments to the script. -#+begin_src sh - #!/bin/sh - /usr/bin/ssh jjanzen.ca "sudo /usr/local/bin/deploy.sh "$@"" -#+end_src diff --git a/macos.local/.flake/home/scripts/launcher.org b/macos.local/.flake/home/scripts/launcher.org deleted file mode 100644 index 0063bf1..0000000 --- a/macos.local/.flake/home/scripts/launcher.org +++ /dev/null @@ -1,7 +0,0 @@ -#+title: Launcher Script - -Use =choose-gui= to launch an application. This is used for a keyboard command to launch applications. -#+begin_src sh - #!/bin/sh - open -n $(find -L /Applications /System/Applications /System/Applications/Utilities ~/Applications /opt/homebrew/opt/emacs-plus@* -maxdepth 1 -name "*.app" | choose -f "SauceCodePro Nerd Font" -s 15) -#+end_src diff --git a/macos.local/.flake/home/scripts/manage-system.org b/macos.local/.flake/home/scripts/manage-system.org deleted file mode 100644 index e8da0d9..0000000 --- a/macos.local/.flake/home/scripts/manage-system.org +++ /dev/null @@ -1,47 +0,0 @@ -#+title: System Management Script - -#+begin_src sh - #!/bin/sh - - usage () - { - echo "Usage: $0 [command] where command is one of" - echo "help - show this message and exit" - echo "backup - push the configuration to the remote" - echo "update - update the system" - echo "install - install the system configurations" - } - - [ "$#" -eq 0 ] && usage && exit 1 - - dir="$pwd" - cd ~/.dotfiles || exit 1 - - case "$1" in - help) - usage - cd "$dir" || exit 1 - exit 0 - ;; - backup) - git push - cd "$dir" || exit 1 - exit 0 - ;; - update) - make update - cd "$dir" || exit 1 - exit 0 - ;; - install) - make install - cd "$dir" || exit 1 - exit 0 - ;; - ,*) - usage - cd "$dir" || exit 1 - exit 1 - ;; - esac -#+end_src diff --git a/macos.local/.flake/home/scripts/remove-quarantine.org b/macos.local/.flake/home/scripts/remove-quarantine.org deleted file mode 100644 index 373c503..0000000 --- a/macos.local/.flake/home/scripts/remove-quarantine.org +++ /dev/null @@ -1,7 +0,0 @@ -#+title: Remove Quarantine - -macOS likes putting applications in quarantine without me wanting. This script removes an application from the quarantine. Remove the app from quarantine by recursively deleting the quarantine attribute on the application. -#+begin_src sh - #!/bin/sh - /usr/bin/xattr -dr com.apple.quarantine "$@" -#+end_src diff --git a/macos.local/.flake/home/services/core.nix.org b/macos.local/.flake/home/services/core.nix.org deleted file mode 100644 index d504770..0000000 --- a/macos.local/.flake/home/services/core.nix.org +++ /dev/null @@ -1,12 +0,0 @@ -#+title: Service Configuration - -Load service configurations. -#+begin_src nix - { config, pkgs, ... }: - - { - imports = [ - ./mpd.nix - ]; - } -#+end_src diff --git a/macos.local/.flake/home/services/mpd.nix.org b/macos.local/.flake/home/services/mpd.nix.org deleted file mode 100644 index f3f7f8b..0000000 --- a/macos.local/.flake/home/services/mpd.nix.org +++ /dev/null @@ -1,49 +0,0 @@ -#+title: =mpd= Configuration - -Configure =mpd= as a music player. =services.mpd= only works on Linux for some reason so I manually write out the configuration here. This is actually a really gross setup and requires manually creating files in =.mpd= and manually starting =mpd=, but it does seem to work at least. -#+begin_src nix - { config, pkgs, ... }: - - { - home.packages = with pkgs; [ - mpd - ]; - home.file."./.mpdconf".text = '' - music_directory "/Volumes/Media/Music" - playlist_directory "~/.mpd/playlists" - db_file "~/.mpd/mpd.db" - log_file "~/.mpd/mpd.log" - pid_file "~/.mpd/mpd.pid" - state_file "~/.mpd/mpdstate" - auto_update "yes" - auto_update_depth "2" - follow_outside_symlinks "yes" - follow_inside_symlinks "yes" - - audio_output { - type "osx" - name "CoreAudio" - mixer_type "software" - } - - decoder { - plugin "mp4ff" - enabled "no" - } - - bind_to_address "127.0.0.1" - port "6600" - user "jjanzen" - - # Visualizer - audio_output { - type "fifo" - name "my_fifo" - path "/tmp/mpd.fifo" - format "44100:16:2" - auto_resample "no" - use_mmap "yes" - } - ''; - } -#+end_src diff --git a/macos.local/.flake/system/aerospace.nix.org b/macos.local/.flake/system/aerospace.nix.org deleted file mode 100644 index a0c72df..0000000 --- a/macos.local/.flake/system/aerospace.nix.org +++ /dev/null @@ -1,96 +0,0 @@ -#+title: Aerospace Configuration - -Enable Aerospace as a window manager for macOS. I have disabled gaps, move the mouse to follow windows, and an =i3=-like binding configuration. -#+begin_src nix - { config, pkgs, ... }: - - { - services.aerospace = { - enable = true; - settings = { - gaps = { - outer.left = 0; - outer.bottom = 0; - outer.top = 0; - outer.right = 0; - }; - on-focus-changed = [ - "move-mouse window-lazy-center" - ]; - on-window-detected = [ - { - "if".app-name-regex-substring = "mpv"; - run = [ - "layout floating" - ]; - } - ]; - workspace-to-monitor-force-assignment = { - "1" = "main"; - "2" = "main"; - "3" = "main"; - "4" = "main"; - "5" = "main"; - "6" = "main"; - "7" = "main"; - "8" = "main"; - "9" = [ - "secondary" - "dell" - ]; - "10" = [ - "secondary" - "built-in" - ]; - }; - mode.main.binding = { - cmd-enter = "exec-and-forget open -n /Applications/Ghostty.app/"; - cmd-shift-enter = "exec-and-forget /opt/homebrew/bin/emacs"; - cmd-d = "exec-and-forget ~/.local/bin/launcher"; - cmd-shift-f = "fullscreen"; - cmd-shift-space = "layout floating tiling"; - - cmd-h = "focus --boundaries-action wrap-around-the-workspace left"; - cmd-j = "focus --boundaries-action wrap-around-the-workspace down"; - cmd-k = "focus --boundaries-action wrap-around-the-workspace up"; - cmd-l = "focus --boundaries-action wrap-around-the-workspace right"; - - cmd-shift-h = "move left"; - cmd-shift-j = "move down"; - cmd-shift-k = "move up"; - cmd-shift-l = "move right"; - - cmd-shift-minus = "resize smart -50"; - cmd-shift-equal = "resize smart +50"; - - cmd-1 = "workspace 1"; - cmd-2 = "workspace 2"; - cmd-3 = "workspace 3"; - cmd-4 = "workspace 4"; - cmd-5 = "workspace 5"; - cmd-6 = "workspace 6"; - cmd-7 = "workspace 7"; - cmd-8 = "workspace 8"; - cmd-9 = "workspace 9"; - cmd-0 = "workspace 10"; - - cmd-shift-1 = "move-node-to-workspace 1"; - cmd-shift-2 = "move-node-to-workspace 2"; - cmd-shift-3 = "move-node-to-workspace 3"; - cmd-shift-4 = "move-node-to-workspace 4"; - cmd-shift-5 = "move-node-to-workspace 5"; - cmd-shift-6 = "move-node-to-workspace 6"; - cmd-shift-7 = "move-node-to-workspace 7"; - cmd-shift-8 = "move-node-to-workspace 8"; - cmd-shift-9 = "move-node-to-workspace 9"; - cmd-shift-0 = "move-node-to-workspace 10"; - - cmd-ctrl-shift-h = "join-with left"; - cmd-ctrl-shift-j = "join-with down"; - cmd-ctrl-shift-k = "join-with up"; - cmd-ctrl-shift-l = "join-with right"; - }; - }; - }; - } -#+end_src diff --git a/macos.local/.flake/system/core.nix.org b/macos.local/.flake/system/core.nix.org deleted file mode 100644 index 18ca960..0000000 --- a/macos.local/.flake/system/core.nix.org +++ /dev/null @@ -1,61 +0,0 @@ -#+title: System Core - -This file imports various system configuration components in addition to enabling flakes and defining the system version. -#+begin_src nix - { config, pkgs, ... }: - - let - inherit (pkgs) aspellWithDicts; - myaspell = aspellWithDicts (d: [d.en d.en-computers d.en-science]); - in { - imports = [ - ./aerospace.nix - ./homebrew.nix - ]; - - # Unfortunately, I sometimes need unfree packages - nixpkgs.config.allowUnfree = true; - - # Install a small number of packages for root - environment.systemPackages = with pkgs; [ - gnupg - myaspell - neovim - ]; - - # Use TouchID for sudo - security.pam.services.sudo_local.touchIdAuth = true; - - # Open text files in neovim by default - environment.variables.EDITOR = "nvim"; - - # Enable nix packages - nix.package = pkgs.nix; - - programs.gnupg.agent.enable = false; - - # Use flakes - nix.settings.experimental-features = "nix-command flakes"; - - # Use zsh as my shell - programs.zsh.enable = true; - - # Enable documentation and make - documentation = { - enable = true; - info.enable = true; - man.enable = true; - }; - - system.stateVersion = 5; - - # Use ARM64 packages - nixpkgs.hostPlatform = "aarch64-darwin"; - - # Define my user - users.users.jjanzen = { - name = "jjanzen"; - home = "/Users/jjanzen"; - }; - } -#+end_src diff --git a/macos.local/.flake/system/homebrew.nix.org b/macos.local/.flake/system/homebrew.nix.org deleted file mode 100644 index 6a65114..0000000 --- a/macos.local/.flake/system/homebrew.nix.org +++ /dev/null @@ -1,118 +0,0 @@ -#+title: Homebrew Configuration - -Set up Homebrew. I disable the quarantine automatically and ensure that the state of Homebrew is exactly as specified here. -#+begin_src nix - { config, pkgs, ... }: - - { - homebrew = { - enable = true; - - caskArgs.no_quarantine = true; - - global.autoUpdate = false; - onActivation = { - autoUpdate = true; - cleanup = "zap"; - upgrade = true; - }; - - taps = [ - "camillescholtz/formulae" - "d12frosted/emacs-plus" - "homebrew/bundle" - "homebrew/cask-fonts" - "homebrew/cask-versions" - "homebrew/services" - "jorgelbg/tap" - "osx-cross/avr" - ]; - - brews = [ - # emacs is handled better by homebrew on mac - { - name = "emacs-plus@30"; - args = [ - "with-native-comp" - "with-imagemagick" - "with-xwidgets" - "with-mailutils" - "with-ctags" - "with-retro-emacs-logo-icon" - ]; - } - - # problematic nix builds - "choose-gui" # nix version fails to build - "clang-format" # nix version screws up clang setup - "openjdk" # there's really no jdk for mac from nix? - "pinentry-touchid" # no nix version - - # need for grading purposes - "avrdude" - "open-mpi" - "open-ocd" - "osx-cross/avr/avr-binutils" - "osx-cross/avr/avarice" - "osx-cross/avr/avr-gcc@14" - - # needed for pdf-tools for emacs - "autoconf" - "automake" - "pkg-config" - "poppler" - - # required by emacs-plus@30 - "imagemagick" - "jansson" - "jpeg" - "libgccjit" - "librsvg" - "zlib" - - "mailutils" - "tree-sitter" - - # required by pinentry-touchid - "libassuan@2" - "gnupg" - "pinentry-mac" - ]; - - # homebrew handles graphical applications better than nix - casks = [ - "audacity" - "blender" - "cabal" - "calibre" - "desmume" - "discord" - "dwarf-fortress-lmp" - "firefox" - "gcc-arm-embedded" - "ghostty" - "gimp" - "godot" - "gzdoom" - "inkscape" - "krita" - "librewolf" - "multimc" - "obs" - "openemu" - "openmw" - "pokemon-showdown" - "proton-mail-bridge" - "protonvpn" - "qbittorrent" - "rar" - "syncthing" - "thunderbird" - "tor-browser" - "vlc" - "whisky" - "zotero" - ]; - }; - } -#+end_src diff --git a/macos.local/flake/flake.lock b/macos.local/flake/flake.lock new file mode 100644 index 0000000..16fab9e --- /dev/null +++ b/macos.local/flake/flake.lock @@ -0,0 +1,69 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741128660, + "narHash": "sha256-GWaZ+KGxWYbOB15CSqktwngq0ccA1l2Ov3aUfl9jeY4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "b1b964ea9348aef08cab514fa88e9c99def6fd63", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741112248, + "narHash": "sha256-Y340xoE1Vgo0eCDJi4srVjuwlr50vYSoyJrZeXHw3n0=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "991bb2f6d46fc2ff7990913c173afdb0318314cb", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1741037377, + "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "02032da4af073d0f6110540c8677f16d4be0117f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/macos.local/flake/flake.nix.org b/macos.local/flake/flake.nix.org new file mode 100644 index 0000000..9a07ccb --- /dev/null +++ b/macos.local/flake/flake.nix.org @@ -0,0 +1,34 @@ +#+title: macOS Nix Configuration + +The root for my macOS nix configuration using flake and home-manager. +#+begin_src nix + { + description = "My Darwin Configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:LnL7/nix-darwin"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager }: { + darwinConfigurations."macos" = nix-darwin.lib.darwinSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./system/core.nix + home-manager.darwinModules.home-manager + { + home-manager.backupFileExtension = "bak"; + home-manager.useGlobalPkgs = false; + home-manager.useUserPackages = true; + home-manager.users.jjanzen = import ./home/core.nix; + } + ]; + }; + + darwinPackages = self.darwinConfigurations."macos".pkgs; + }; + } +#+end_src diff --git a/macos.local/flake/home/.wallpaper b/macos.local/flake/home/.wallpaper new file mode 120000 index 0000000..316db81 --- /dev/null +++ b/macos.local/flake/home/.wallpaper @@ -0,0 +1 @@ +../../../common/.wallpaper \ No newline at end of file diff --git a/macos.local/flake/home/clang-format.nix.org b/macos.local/flake/home/clang-format.nix.org new file mode 120000 index 0000000..db7166a --- /dev/null +++ b/macos.local/flake/home/clang-format.nix.org @@ -0,0 +1 @@ +../../../common/.flake/home/clang-format.nix.org \ No newline at end of file diff --git a/macos.local/flake/home/core.nix.org b/macos.local/flake/home/core.nix.org new file mode 100644 index 0000000..cb2b34d --- /dev/null +++ b/macos.local/flake/home/core.nix.org @@ -0,0 +1,30 @@ +#+title: Home Configuration + +Set up home manager for my user account and import submodules. Define my user as =jjanzen= and specify the wallpaper and add items to the =PATH= variable. +#+begin_src nix + { config, pkgs, ... }: + + { + imports = [ + ./clang-format.nix + ./fonts.nix + ./programs/core.nix + ./scripts/core.nix + ./services/core.nix + ]; + + home.stateVersion = "24.05"; + programs.home-manager.enable = true; + + home.username = "jjanzen"; + home.homeDirectory = "/Users/jjanzen"; + + home.file.".wallpaper".source = ./.wallpaper; + + home.sessionPath = [ + "$HOME/.local/bin" + "/usr/local/bin" + "/opt/homebrew/bin" + ]; + } +#+end_src diff --git a/macos.local/flake/home/fonts.nix.org b/macos.local/flake/home/fonts.nix.org new file mode 120000 index 0000000..53bec1c --- /dev/null +++ b/macos.local/flake/home/fonts.nix.org @@ -0,0 +1 @@ +../../../common/.flake/home/fonts.nix.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/.DS_Store b/macos.local/flake/home/programs/.DS_Store new file mode 100644 index 0000000..668825b Binary files /dev/null and b/macos.local/flake/home/programs/.DS_Store differ diff --git a/macos.local/flake/home/programs/core.nix.org b/macos.local/flake/home/programs/core.nix.org new file mode 100644 index 0000000..24b2555 --- /dev/null +++ b/macos.local/flake/home/programs/core.nix.org @@ -0,0 +1,68 @@ +#+title: Core Program Configuration + +Import configurations for programs and install programs with no configuration. +#+begin_src nix + { config, pkgs, ... }: + + { + imports = [ + ./emacs/core.nix + ./fastfetch.nix + ./ghostty.nix + ./git.nix + ./ncmpcpp.nix + ./neovim.nix + ./ssh.nix + ./zsh/core.nix + ]; + + home.packages = with pkgs; [ + aescrypt + bash-language-server + bear + bison + cmake + cmake-language-server + curl + dos2unix + eza + ffmpeg + fzf + gnutls + go + gopls + gpgme + htop + hunspell + hyfetch # TODO: configure + inetutils + ispell + lesspipe + marksman + mailutils + meson + mpv + ninja + nodejs_23 + notcurses + p7zip + pandoc + python312 + python312Packages.black + python312Packages.pylint + python312Packages.python-lsp-server + ripgrep + rsync + rustup + shellcheck + shfmt + texliveFull + typescript-language-server + vscode-langservers-extracted + wget + yt-dlp + zig + zls + ]; + } +#+end_src diff --git a/macos.local/flake/home/programs/emacs/core.nix.org b/macos.local/flake/home/programs/emacs/core.nix.org new file mode 100644 index 0000000..2bb4237 --- /dev/null +++ b/macos.local/flake/home/programs/emacs/core.nix.org @@ -0,0 +1,14 @@ +#+title: Emacs Configuration + +Here is my Emacs configuration. This file just defines configurations that should exist. Emacs is installed with Homebrew. +#+begin_src nix + { config, pkgs, ... }: + + { + home.file = { + "./.config/emacs/early-init.el".source = ./early-init.el; + "./.config/emacs/feed.org".source = ./feed.org; + "./.config/emacs/init.el".source = ./init.el; + }; + } +#+end_src diff --git a/macos.local/flake/home/programs/emacs/early-init.el.org b/macos.local/flake/home/programs/emacs/early-init.el.org new file mode 120000 index 0000000..7c20436 --- /dev/null +++ b/macos.local/flake/home/programs/emacs/early-init.el.org @@ -0,0 +1 @@ +../../../../../common/.config/emacs/early-init.el.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/emacs/feed.org.org b/macos.local/flake/home/programs/emacs/feed.org.org new file mode 120000 index 0000000..d074855 --- /dev/null +++ b/macos.local/flake/home/programs/emacs/feed.org.org @@ -0,0 +1 @@ +../../../../../common/.config/emacs/feed.org.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/emacs/init.el.org b/macos.local/flake/home/programs/emacs/init.el.org new file mode 120000 index 0000000..6b2f721 --- /dev/null +++ b/macos.local/flake/home/programs/emacs/init.el.org @@ -0,0 +1 @@ +../../../../../common/.config/emacs/init.el.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/fastfetch.nix.org b/macos.local/flake/home/programs/fastfetch.nix.org new file mode 120000 index 0000000..25e2716 --- /dev/null +++ b/macos.local/flake/home/programs/fastfetch.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/fastfetch.nix.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/ghostty.nix.org b/macos.local/flake/home/programs/ghostty.nix.org new file mode 100644 index 0000000..29bc15a --- /dev/null +++ b/macos.local/flake/home/programs/ghostty.nix.org @@ -0,0 +1,23 @@ +#+title: ghostty Configuration + +I use =ghostty= as a terminal emulator on macOS. I disable auto-update and set some sensible options. +#+begin_src nix + { config, pkgs, ... }: + + { + home.file."./.config/ghostty/config".text = '' + auto-update = "off" + background-blur-radius = 20 + background-opacity = 0.8 + clipboard-trim-trailing-spaces = true + font-family = "SauceCodePro Nerd Font" + font-thicken = true + macos-option-as-alt = true + macos-window-shadow = false + mouse-hide-while-typing = true + quit-after-last-window-closed = true + theme = "Builtin Light" + window-decoration = true + ''; + } +#+end_src diff --git a/macos.local/flake/home/programs/git.nix.org b/macos.local/flake/home/programs/git.nix.org new file mode 120000 index 0000000..e8ddd28 --- /dev/null +++ b/macos.local/flake/home/programs/git.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/git.nix.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/ncmpcpp.nix.org b/macos.local/flake/home/programs/ncmpcpp.nix.org new file mode 100644 index 0000000..6c697ef --- /dev/null +++ b/macos.local/flake/home/programs/ncmpcpp.nix.org @@ -0,0 +1,28 @@ +#+title: =ncmpcpp= Configuration + +Enable =vi=-like controls and specify directories and =mpd= address. +#+begin_src nix + { config, pkgs, ... }: + + { + programs.ncmpcpp = { + enable = true; + bindings = [ + { key = "j"; command = "scroll_down"; } + { key = "k"; command = "scroll_up"; } + { key = "h"; command = "previous_column"; } + { key = "l"; command = "next_column"; } + { key = "g"; command = "move_home"; } + { key = "G"; command = "move_end"; } + { key = "n"; command = "next_found_item"; } + { key = "N"; command = "previous_found_item"; } + ]; + mpdMusicDir = "/Volumes/Media/Music"; + settings = { + ncmpcpp_directory = "~/.config/nmcpcpp"; + mpd_host = "localhost"; + mpd_port = "6600"; + }; + }; + } +#+end_src diff --git a/macos.local/flake/home/programs/neovim.nix.org b/macos.local/flake/home/programs/neovim.nix.org new file mode 120000 index 0000000..871eafa --- /dev/null +++ b/macos.local/flake/home/programs/neovim.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/neovim.nix.org \ No newline at end of file diff --git a/macos.local/flake/home/programs/ssh.nix.org b/macos.local/flake/home/programs/ssh.nix.org new file mode 100644 index 0000000..28f779f --- /dev/null +++ b/macos.local/flake/home/programs/ssh.nix.org @@ -0,0 +1,44 @@ +#+title: SSH Configuration + +Configure SSH. Keys should be added to the SSH agent. Use the system keychain on all configurations. +#+begin_src nix + { config, pkgs, ... }: + { + programs.ssh = { + enable = true; + addKeysToAgent = "yes"; + matchBlocks = { + "*" = { + identityFile = "~/.ssh/id_ed25519"; + extraOptions = { + "UseKeychain" = "yes"; + }; + }; + + "aviary" = { + hostname = "aviary.cs.umanitoba.ca"; + user = "janzenj2"; + setEnv = { + "TERM" = "xterm"; + }; + }; + + "jjanzen.ca" = { + setEnv = { + "TERM" = "xterm"; + }; + }; + + "oracle" = { + setEnv = { + "TERM" = "xterm"; + }; + hostname = "jjanzen.ca"; + identityFile = "~/.ssh/oracle"; + identitiesOnly = true; + user = "opc"; + }; + }; + }; + } +#+end_src diff --git a/macos.local/flake/home/programs/zsh/core.nix.org b/macos.local/flake/home/programs/zsh/core.nix.org new file mode 100644 index 0000000..84e9aff --- /dev/null +++ b/macos.local/flake/home/programs/zsh/core.nix.org @@ -0,0 +1,36 @@ +#+title: ZSH Configuration + +Open =zsh= configuration. +#+begin_src nix + { config, pkgs, ... }: + + { + programs.zsh = { + enable = true; + + autocd = true; + + autosuggestion.enable = true; + + defaultKeymap = "emacs"; + + history = { + append = true; + ignoreAllDups = true; + }; + + shellAliases = { + "ll" = "ls -alF"; + "la" = "ls -a"; + "l" = "ls -F"; + "sl" = "ls"; + }; + + syntaxHighlighting.enable = true; + + initExtra = builtins.readFile ./init-extra.sh; + + profileExtra = builtins.readFile ./profile-extra.sh; + }; + } +#+end_src diff --git a/macos.local/flake/home/programs/zsh/init-extra.sh.org b/macos.local/flake/home/programs/zsh/init-extra.sh.org new file mode 100644 index 0000000..8255ce1 --- /dev/null +++ b/macos.local/flake/home/programs/zsh/init-extra.sh.org @@ -0,0 +1,28 @@ +#+title: ZSH Extra Initialization Code + +Define optional aliases. +#+begin_src sh + which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" + which eza &> /dev/null && alias ls=eza +#+end_src + +Enable =fzf= extensions for =zsh=. +#+begin_src sh + which zsh &> /dev/null && source <(fzf --zsh) +#+end_src + +Enable git status in =zsh= prompt. +#+begin_src sh + parse_git_dirty() { + git_status="$(git status 2> /dev/null)" + [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" + [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" + [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" + [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" + } + setopt prompt_subst + autoload -Uz vcs_info + precmd () { vcs_info } + zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) + PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' +#+end_src diff --git a/macos.local/flake/home/programs/zsh/profile-extra.sh.org b/macos.local/flake/home/programs/zsh/profile-extra.sh.org new file mode 100644 index 0000000..64457ed --- /dev/null +++ b/macos.local/flake/home/programs/zsh/profile-extra.sh.org @@ -0,0 +1,10 @@ +#+title: Profile Extra Code + +Enable =ssh-agent= at login. +#+begin_src sh + if [ ! -S ~/.ssh/ssh_auth_sock ]; then + eval `ssh-agent` > /dev/null + ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock + fi + export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock +#+end_src diff --git a/macos.local/flake/home/scripts/core.nix.org b/macos.local/flake/home/scripts/core.nix.org new file mode 100644 index 0000000..f3fd314 --- /dev/null +++ b/macos.local/flake/home/scripts/core.nix.org @@ -0,0 +1,27 @@ +#+title: Custom Scripts + +Import various scripts useful on my system. +#+begin_src nix + { config, pkgs, ... }: + + { + home.file = { + "./.local/bin/deploy-website" = { + executable = true; + source = ./deploy-website; + }; + "./.local/bin/launcher" = { + executable = true; + source = ./launcher; + }; + "./.local/bin/remove-quarantine" = { + executable = true; + source = ./remove-quarantine; + }; + "./.local/bin/manage-system" = { + executable = true; + source = ./manage-system; + }; + }; + } +#+end_src diff --git a/macos.local/flake/home/scripts/deploy-website.org b/macos.local/flake/home/scripts/deploy-website.org new file mode 100644 index 0000000..76e5d54 --- /dev/null +++ b/macos.local/flake/home/scripts/deploy-website.org @@ -0,0 +1,7 @@ +#+title: Website Deploy Script + +Deploy my website from a specified branch by using =ssh= to get into my server and running the deploy script, passing command line arguments to the script. +#+begin_src sh + #!/bin/sh + /usr/bin/ssh jjanzen.ca "sudo /usr/local/bin/deploy.sh "$@"" +#+end_src diff --git a/macos.local/flake/home/scripts/launcher.org b/macos.local/flake/home/scripts/launcher.org new file mode 100644 index 0000000..0063bf1 --- /dev/null +++ b/macos.local/flake/home/scripts/launcher.org @@ -0,0 +1,7 @@ +#+title: Launcher Script + +Use =choose-gui= to launch an application. This is used for a keyboard command to launch applications. +#+begin_src sh + #!/bin/sh + open -n $(find -L /Applications /System/Applications /System/Applications/Utilities ~/Applications /opt/homebrew/opt/emacs-plus@* -maxdepth 1 -name "*.app" | choose -f "SauceCodePro Nerd Font" -s 15) +#+end_src diff --git a/macos.local/flake/home/scripts/manage-system.org b/macos.local/flake/home/scripts/manage-system.org new file mode 100644 index 0000000..e8da0d9 --- /dev/null +++ b/macos.local/flake/home/scripts/manage-system.org @@ -0,0 +1,47 @@ +#+title: System Management Script + +#+begin_src sh + #!/bin/sh + + usage () + { + echo "Usage: $0 [command] where command is one of" + echo "help - show this message and exit" + echo "backup - push the configuration to the remote" + echo "update - update the system" + echo "install - install the system configurations" + } + + [ "$#" -eq 0 ] && usage && exit 1 + + dir="$pwd" + cd ~/.dotfiles || exit 1 + + case "$1" in + help) + usage + cd "$dir" || exit 1 + exit 0 + ;; + backup) + git push + cd "$dir" || exit 1 + exit 0 + ;; + update) + make update + cd "$dir" || exit 1 + exit 0 + ;; + install) + make install + cd "$dir" || exit 1 + exit 0 + ;; + ,*) + usage + cd "$dir" || exit 1 + exit 1 + ;; + esac +#+end_src diff --git a/macos.local/flake/home/scripts/remove-quarantine.org b/macos.local/flake/home/scripts/remove-quarantine.org new file mode 100644 index 0000000..373c503 --- /dev/null +++ b/macos.local/flake/home/scripts/remove-quarantine.org @@ -0,0 +1,7 @@ +#+title: Remove Quarantine + +macOS likes putting applications in quarantine without me wanting. This script removes an application from the quarantine. Remove the app from quarantine by recursively deleting the quarantine attribute on the application. +#+begin_src sh + #!/bin/sh + /usr/bin/xattr -dr com.apple.quarantine "$@" +#+end_src diff --git a/macos.local/flake/home/services/core.nix.org b/macos.local/flake/home/services/core.nix.org new file mode 100644 index 0000000..d504770 --- /dev/null +++ b/macos.local/flake/home/services/core.nix.org @@ -0,0 +1,12 @@ +#+title: Service Configuration + +Load service configurations. +#+begin_src nix + { config, pkgs, ... }: + + { + imports = [ + ./mpd.nix + ]; + } +#+end_src diff --git a/macos.local/flake/home/services/mpd.nix.org b/macos.local/flake/home/services/mpd.nix.org new file mode 100644 index 0000000..f3f7f8b --- /dev/null +++ b/macos.local/flake/home/services/mpd.nix.org @@ -0,0 +1,49 @@ +#+title: =mpd= Configuration + +Configure =mpd= as a music player. =services.mpd= only works on Linux for some reason so I manually write out the configuration here. This is actually a really gross setup and requires manually creating files in =.mpd= and manually starting =mpd=, but it does seem to work at least. +#+begin_src nix + { config, pkgs, ... }: + + { + home.packages = with pkgs; [ + mpd + ]; + home.file."./.mpdconf".text = '' + music_directory "/Volumes/Media/Music" + playlist_directory "~/.mpd/playlists" + db_file "~/.mpd/mpd.db" + log_file "~/.mpd/mpd.log" + pid_file "~/.mpd/mpd.pid" + state_file "~/.mpd/mpdstate" + auto_update "yes" + auto_update_depth "2" + follow_outside_symlinks "yes" + follow_inside_symlinks "yes" + + audio_output { + type "osx" + name "CoreAudio" + mixer_type "software" + } + + decoder { + plugin "mp4ff" + enabled "no" + } + + bind_to_address "127.0.0.1" + port "6600" + user "jjanzen" + + # Visualizer + audio_output { + type "fifo" + name "my_fifo" + path "/tmp/mpd.fifo" + format "44100:16:2" + auto_resample "no" + use_mmap "yes" + } + ''; + } +#+end_src diff --git a/macos.local/flake/system/aerospace.nix.org b/macos.local/flake/system/aerospace.nix.org new file mode 100644 index 0000000..a0c72df --- /dev/null +++ b/macos.local/flake/system/aerospace.nix.org @@ -0,0 +1,96 @@ +#+title: Aerospace Configuration + +Enable Aerospace as a window manager for macOS. I have disabled gaps, move the mouse to follow windows, and an =i3=-like binding configuration. +#+begin_src nix + { config, pkgs, ... }: + + { + services.aerospace = { + enable = true; + settings = { + gaps = { + outer.left = 0; + outer.bottom = 0; + outer.top = 0; + outer.right = 0; + }; + on-focus-changed = [ + "move-mouse window-lazy-center" + ]; + on-window-detected = [ + { + "if".app-name-regex-substring = "mpv"; + run = [ + "layout floating" + ]; + } + ]; + workspace-to-monitor-force-assignment = { + "1" = "main"; + "2" = "main"; + "3" = "main"; + "4" = "main"; + "5" = "main"; + "6" = "main"; + "7" = "main"; + "8" = "main"; + "9" = [ + "secondary" + "dell" + ]; + "10" = [ + "secondary" + "built-in" + ]; + }; + mode.main.binding = { + cmd-enter = "exec-and-forget open -n /Applications/Ghostty.app/"; + cmd-shift-enter = "exec-and-forget /opt/homebrew/bin/emacs"; + cmd-d = "exec-and-forget ~/.local/bin/launcher"; + cmd-shift-f = "fullscreen"; + cmd-shift-space = "layout floating tiling"; + + cmd-h = "focus --boundaries-action wrap-around-the-workspace left"; + cmd-j = "focus --boundaries-action wrap-around-the-workspace down"; + cmd-k = "focus --boundaries-action wrap-around-the-workspace up"; + cmd-l = "focus --boundaries-action wrap-around-the-workspace right"; + + cmd-shift-h = "move left"; + cmd-shift-j = "move down"; + cmd-shift-k = "move up"; + cmd-shift-l = "move right"; + + cmd-shift-minus = "resize smart -50"; + cmd-shift-equal = "resize smart +50"; + + cmd-1 = "workspace 1"; + cmd-2 = "workspace 2"; + cmd-3 = "workspace 3"; + cmd-4 = "workspace 4"; + cmd-5 = "workspace 5"; + cmd-6 = "workspace 6"; + cmd-7 = "workspace 7"; + cmd-8 = "workspace 8"; + cmd-9 = "workspace 9"; + cmd-0 = "workspace 10"; + + cmd-shift-1 = "move-node-to-workspace 1"; + cmd-shift-2 = "move-node-to-workspace 2"; + cmd-shift-3 = "move-node-to-workspace 3"; + cmd-shift-4 = "move-node-to-workspace 4"; + cmd-shift-5 = "move-node-to-workspace 5"; + cmd-shift-6 = "move-node-to-workspace 6"; + cmd-shift-7 = "move-node-to-workspace 7"; + cmd-shift-8 = "move-node-to-workspace 8"; + cmd-shift-9 = "move-node-to-workspace 9"; + cmd-shift-0 = "move-node-to-workspace 10"; + + cmd-ctrl-shift-h = "join-with left"; + cmd-ctrl-shift-j = "join-with down"; + cmd-ctrl-shift-k = "join-with up"; + cmd-ctrl-shift-l = "join-with right"; + }; + }; + }; + } +#+end_src diff --git a/macos.local/flake/system/core.nix.org b/macos.local/flake/system/core.nix.org new file mode 100644 index 0000000..18ca960 --- /dev/null +++ b/macos.local/flake/system/core.nix.org @@ -0,0 +1,61 @@ +#+title: System Core + +This file imports various system configuration components in addition to enabling flakes and defining the system version. +#+begin_src nix + { config, pkgs, ... }: + + let + inherit (pkgs) aspellWithDicts; + myaspell = aspellWithDicts (d: [d.en d.en-computers d.en-science]); + in { + imports = [ + ./aerospace.nix + ./homebrew.nix + ]; + + # Unfortunately, I sometimes need unfree packages + nixpkgs.config.allowUnfree = true; + + # Install a small number of packages for root + environment.systemPackages = with pkgs; [ + gnupg + myaspell + neovim + ]; + + # Use TouchID for sudo + security.pam.services.sudo_local.touchIdAuth = true; + + # Open text files in neovim by default + environment.variables.EDITOR = "nvim"; + + # Enable nix packages + nix.package = pkgs.nix; + + programs.gnupg.agent.enable = false; + + # Use flakes + nix.settings.experimental-features = "nix-command flakes"; + + # Use zsh as my shell + programs.zsh.enable = true; + + # Enable documentation and make + documentation = { + enable = true; + info.enable = true; + man.enable = true; + }; + + system.stateVersion = 5; + + # Use ARM64 packages + nixpkgs.hostPlatform = "aarch64-darwin"; + + # Define my user + users.users.jjanzen = { + name = "jjanzen"; + home = "/Users/jjanzen"; + }; + } +#+end_src diff --git a/macos.local/flake/system/homebrew.nix.org b/macos.local/flake/system/homebrew.nix.org new file mode 100644 index 0000000..6a65114 --- /dev/null +++ b/macos.local/flake/system/homebrew.nix.org @@ -0,0 +1,118 @@ +#+title: Homebrew Configuration + +Set up Homebrew. I disable the quarantine automatically and ensure that the state of Homebrew is exactly as specified here. +#+begin_src nix + { config, pkgs, ... }: + + { + homebrew = { + enable = true; + + caskArgs.no_quarantine = true; + + global.autoUpdate = false; + onActivation = { + autoUpdate = true; + cleanup = "zap"; + upgrade = true; + }; + + taps = [ + "camillescholtz/formulae" + "d12frosted/emacs-plus" + "homebrew/bundle" + "homebrew/cask-fonts" + "homebrew/cask-versions" + "homebrew/services" + "jorgelbg/tap" + "osx-cross/avr" + ]; + + brews = [ + # emacs is handled better by homebrew on mac + { + name = "emacs-plus@30"; + args = [ + "with-native-comp" + "with-imagemagick" + "with-xwidgets" + "with-mailutils" + "with-ctags" + "with-retro-emacs-logo-icon" + ]; + } + + # problematic nix builds + "choose-gui" # nix version fails to build + "clang-format" # nix version screws up clang setup + "openjdk" # there's really no jdk for mac from nix? + "pinentry-touchid" # no nix version + + # need for grading purposes + "avrdude" + "open-mpi" + "open-ocd" + "osx-cross/avr/avr-binutils" + "osx-cross/avr/avarice" + "osx-cross/avr/avr-gcc@14" + + # needed for pdf-tools for emacs + "autoconf" + "automake" + "pkg-config" + "poppler" + + # required by emacs-plus@30 + "imagemagick" + "jansson" + "jpeg" + "libgccjit" + "librsvg" + "zlib" + + "mailutils" + "tree-sitter" + + # required by pinentry-touchid + "libassuan@2" + "gnupg" + "pinentry-mac" + ]; + + # homebrew handles graphical applications better than nix + casks = [ + "audacity" + "blender" + "cabal" + "calibre" + "desmume" + "discord" + "dwarf-fortress-lmp" + "firefox" + "gcc-arm-embedded" + "ghostty" + "gimp" + "godot" + "gzdoom" + "inkscape" + "krita" + "librewolf" + "multimc" + "obs" + "openemu" + "openmw" + "pokemon-showdown" + "proton-mail-bridge" + "protonvpn" + "qbittorrent" + "rar" + "syncthing" + "thunderbird" + "tor-browser" + "vlc" + "whisky" + "zotero" + ]; + }; + } +#+end_src diff --git a/nixos/.flake/flake.lock b/nixos/.flake/flake.lock deleted file mode 100644 index 1653154..0000000 --- a/nixos/.flake/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "home-manager": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1727383923, - "narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "ffe2d07e771580a005e675108212597e5b367d2d", - "type": "github" - }, - "original": { - "id": "home-manager", - "type": "indirect" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1726937504, - "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9357f4f23713673f310988025d9dc261c20e70c6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1727634051, - "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/nixos/.flake/flake.nix.org b/nixos/.flake/flake.nix.org deleted file mode 100644 index c8ee8dd..0000000 --- a/nixos/.flake/flake.nix.org +++ /dev/null @@ -1,34 +0,0 @@ -#+title: Flake Root - -I use the unstable branch of =nixpkgs=. This file defines the outputs for my configuration (system and home). -#+begin_src nix - { - description = "My NixOS Configuration"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - }; - - outputs = { - self, - nixpkgs, - home-manager, - ... - }@inputs: { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - ./system/core.nix - home-manager.nixosModules.home-manager - { - home-manager.backupFileExtension = "bak"; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.jjanzen = import ./home/core.nix; - } - ]; - }; - }; - } -#+end_src diff --git a/nixos/.flake/home/.wallpaper b/nixos/.flake/home/.wallpaper deleted file mode 120000 index 316db81..0000000 --- a/nixos/.flake/home/.wallpaper +++ /dev/null @@ -1 +0,0 @@ -../../../common/.wallpaper \ No newline at end of file diff --git a/nixos/.flake/home/clang-format.nix.org b/nixos/.flake/home/clang-format.nix.org deleted file mode 120000 index db7166a..0000000 --- a/nixos/.flake/home/clang-format.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../common/.flake/home/clang-format.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/core.nix.org b/nixos/.flake/home/core.nix.org deleted file mode 100644 index ec135d3..0000000 --- a/nixos/.flake/home/core.nix.org +++ /dev/null @@ -1,25 +0,0 @@ -#+title: Core Home Configuration - -Set up home manager for my user account and import submodules. -#+begin_src nix :tangle ~/.flake/home/core.nix :mkdirp yes - { config, pkgs, ... }: - - { - imports = [ - ./clang-format.nix - ./cursor.nix - ./fonts.nix - ./hyprland.nix - ./programs/core.nix - ./scripts.nix - ./services/core.nix - ]; - - home.username = "jjanzen"; - home.homeDirectory = "/home/jjanzen"; - home.file.".wallpaper".source = ./.wallpaper; - - home.stateVersion = "24.05"; - programs.home-manager.enable = true; - } -#+end_src diff --git a/nixos/.flake/home/cursor.nix.org b/nixos/.flake/home/cursor.nix.org deleted file mode 120000 index 3d3d406..0000000 --- a/nixos/.flake/home/cursor.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../common/.flake/home/cursor.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/fonts.nix.org b/nixos/.flake/home/fonts.nix.org deleted file mode 120000 index 53bec1c..0000000 --- a/nixos/.flake/home/fonts.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../common/.flake/home/fonts.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/hyprland.nix.org b/nixos/.flake/home/hyprland.nix.org deleted file mode 120000 index d2a0693..0000000 --- a/nixos/.flake/home/hyprland.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../common/.flake/home/hyprland.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/core.nix.org b/nixos/.flake/home/programs/core.nix.org deleted file mode 100644 index 9557c8b..0000000 --- a/nixos/.flake/home/programs/core.nix.org +++ /dev/null @@ -1,52 +0,0 @@ -#+title: Core Program Configuration - -This is the core of my program configuration. This file installs programs that do not require additional configuration. Note that Discord is not FOSS and that =prismlauncher= is a launcher for Minecraft. -#+begin_src nix :tangle ~/.flake/home/programs/core.nix :mkdirp yes - { config, pkgs, ... }: - - { - imports = [ - ./emacs/core.nix - ./fastfetch.nix - ./foot.nix - ./git.nix - ./hyprlock.nix - ./ncmpcpp.nix - ./neovim.nix - ./ssh.nix - ./waybar.nix - ./zsh.nix - ]; - - home.packages = with pkgs; [ - discord # not FOSS - clang-tools - eza - fuzzel - ispell - gcc - gzdoom - htop - hyfetch - hyprshot - lesspipe - mpc-cli - mpv - networkmanagerapplet - obs-studio - openresolv - openvpn - pavucontrol - prismlauncher # minecraft - python3 - python312Packages.python-lsp-server - qbittorrent - retroarchFull - swaybg - texliveFull - unzip - zip - zotero - ]; - } -#+end_src diff --git a/nixos/.flake/home/programs/emacs b/nixos/.flake/home/programs/emacs deleted file mode 120000 index 39d7462..0000000 --- a/nixos/.flake/home/programs/emacs +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/emacs \ No newline at end of file diff --git a/nixos/.flake/home/programs/fastfetch.nix.org b/nixos/.flake/home/programs/fastfetch.nix.org deleted file mode 120000 index 25e2716..0000000 --- a/nixos/.flake/home/programs/fastfetch.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/fastfetch.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/foot.nix.org b/nixos/.flake/home/programs/foot.nix.org deleted file mode 120000 index 6197c4a..0000000 --- a/nixos/.flake/home/programs/foot.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/foot.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/git.nix.org b/nixos/.flake/home/programs/git.nix.org deleted file mode 120000 index e8ddd28..0000000 --- a/nixos/.flake/home/programs/git.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/git.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/hyprlock.nix.org b/nixos/.flake/home/programs/hyprlock.nix.org deleted file mode 120000 index 7a25ac8..0000000 --- a/nixos/.flake/home/programs/hyprlock.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/hyprlock.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/ncmpcpp.nix.org b/nixos/.flake/home/programs/ncmpcpp.nix.org deleted file mode 120000 index f91dfd3..0000000 --- a/nixos/.flake/home/programs/ncmpcpp.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/ncmpcpp.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/neovim.nix.org b/nixos/.flake/home/programs/neovim.nix.org deleted file mode 120000 index 871eafa..0000000 --- a/nixos/.flake/home/programs/neovim.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/neovim.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/ssh.nix.org b/nixos/.flake/home/programs/ssh.nix.org deleted file mode 120000 index 363ead0..0000000 --- a/nixos/.flake/home/programs/ssh.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/ssh.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/waybar.nix.org b/nixos/.flake/home/programs/waybar.nix.org deleted file mode 120000 index 04d9dd3..0000000 --- a/nixos/.flake/home/programs/waybar.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/waybar.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/programs/zsh.nix.org b/nixos/.flake/home/programs/zsh.nix.org deleted file mode 120000 index 59d4ec7..0000000 --- a/nixos/.flake/home/programs/zsh.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/programs/zsh.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/scripts.nix.org b/nixos/.flake/home/scripts.nix.org deleted file mode 100644 index b98b389..0000000 --- a/nixos/.flake/home/scripts.nix.org +++ /dev/null @@ -1,43 +0,0 @@ -#+title: Custom Scripts - -Open script container. -#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes - { config, pkgs, ... }: - - { - home.file = { -#+end_src - -Use =fuzzel= to open a menu to power off, reboot, or log out. -#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes - ".local/bin/poweroptions.sh" = { - text = '' - #!/bin/sh - - getoption () { - fuzzel --dmenu -l 3 -x 1 -r 10 << EOF - 󰐥 power off - 󰜉 restart - 󰍃 logout - EOF - } - - option=$(getoption | xargs) - case $option in - '󰐥 power off') - systemctl poweroff;; - '󰜉 restart') - systemctl reboot;; - '󰍃 logout') - hyprctl dispatch exit;; - esac - ''; - executable = true; - }; -#+end_src - -Close script container. -#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes - }; - } -#+end_src diff --git a/nixos/.flake/home/services/core.nix.org b/nixos/.flake/home/services/core.nix.org deleted file mode 100644 index 7fbc333..0000000 --- a/nixos/.flake/home/services/core.nix.org +++ /dev/null @@ -1,19 +0,0 @@ -#+title: Core Service Configuration - -Import service configurations. -#+begin_src nix :tangle ~/.flake/home/services/core.nix :mkdirp yes - { config, pkgs, ... }: - - { - imports = [ - ./emacs.nix - ./mako.nix - ./mpd.nix - ./syncthing.nix - ]; - - home.packages = with pkgs; [ - mpdscribble - ]; - } -#+end_src diff --git a/nixos/.flake/home/services/emacs.nix.org b/nixos/.flake/home/services/emacs.nix.org deleted file mode 120000 index 45c44ee..0000000 --- a/nixos/.flake/home/services/emacs.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/services/emacs.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/services/mako.nix.org b/nixos/.flake/home/services/mako.nix.org deleted file mode 120000 index b4d7e40..0000000 --- a/nixos/.flake/home/services/mako.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/services/mako.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/services/mpd.nix.org b/nixos/.flake/home/services/mpd.nix.org deleted file mode 120000 index 4b76825..0000000 --- a/nixos/.flake/home/services/mpd.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/services/mpd.nix.org \ No newline at end of file diff --git a/nixos/.flake/home/services/syncthing.nix.org b/nixos/.flake/home/services/syncthing.nix.org deleted file mode 120000 index 8d42514..0000000 --- a/nixos/.flake/home/services/syncthing.nix.org +++ /dev/null @@ -1 +0,0 @@ -../../../../common/.flake/home/services/syncthing.nix.org \ No newline at end of file diff --git a/nixos/.flake/system/boot.nix.org b/nixos/.flake/system/boot.nix.org deleted file mode 100644 index fe98542..0000000 --- a/nixos/.flake/system/boot.nix.org +++ /dev/null @@ -1,11 +0,0 @@ -#+title: Boot Configuration - -Enable =systemd-boot= as my boot loader. -#+begin_src nix :tangle ~/.flake/system/boot.nix :mkdirp yes -{ config, lib, pkgs, ... }: - -{ - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; -} -#+end_src diff --git a/nixos/.flake/system/core.nix.org b/nixos/.flake/system/core.nix.org deleted file mode 100644 index e909198..0000000 --- a/nixos/.flake/system/core.nix.org +++ /dev/null @@ -1,21 +0,0 @@ -#+title: System Core - -This file imports various system configuration components in addition to enabling flakes and defining the system version. -#+begin_src nix :tangle ~/.flake/system/core.nix :mkdirp yes -{ config, lib, pkgs, ... }: - -{ - imports = [ - ./boot.nix - ./desktop.nix - ./hardware-configuration.nix - ./locale.nix - ./network.nix - ./users.nix - ]; - - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - system.stateVersion = "24.05"; -} -#+end_src diff --git a/nixos/.flake/system/desktop.nix.org b/nixos/.flake/system/desktop.nix.org deleted file mode 100644 index eef6eef..0000000 --- a/nixos/.flake/system/desktop.nix.org +++ /dev/null @@ -1,116 +0,0 @@ -#+title: Desktop System Configuration - -Open the desktop configuration. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - { config, lib, pkgs, ... }: - - { -#+end_src - -Allow unfree packages on this system. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - nixpkgs.config.allowUnfree = true; -#+end_src - -Install necessary packages for the desktop. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - environment.systemPackages = with pkgs; [ - dolphin - firefox - git - greetd.tuigreet - kitty - gnumake - neovim - python3 - wget - ]; -#+end_src - -Install Steam. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - }; -#+end_src - -Use Neovim as my default editor. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - environment.variables.EDITOR = "nvim"; -#+end_src - -Enable GPG agent globally. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; -#+end_src - -Install =zsh= and set up completions. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - programs.zsh.enable = true; - environment.pathsToLink = [ "/share/zsh" ]; -#+end_src - -Use the =us= keyboard layout. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - services.xserver.xkb.layout = "us"; -#+end_src - -Install Hyprland as a window manager. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - services.xserver.enable = true; - xdg.portal.enable = true; - programs.hyprland.enable = true; - environment.sessionVariables.NIXOS_OZONE_WL = "1"; -#+end_src - -Enable =pam= support for Hyprlock. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - security.pam.services.hyprlock = {}; -#+end_src - -Enable =greetd= with =tuigreet= as my login manager. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - services.greetd = { - enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session --sessions ${pkgs.hyprland}/share/wayland-sessions --cmd \"dbus-run-session Hyprland\""; - user = "greeter"; - }; - }; - }; - systemd.services.greetd.serviceConfig = { - Type = "idle"; - StandardInput = "tty"; - StanardOutput = "tty"; - StandardError = "journal"; - TTYReset = true; - TTYVHangup = true; - TTYVTDisallocate = true; - }; -#+end_src - -Enable PipeWire. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - services.pipewire = { - enable = true; - pulse.enable = true; - }; -#+end_src - -Enable GNOME Keyring. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - services.gnome.gnome-keyring.enable = true; - security.pam.services.greetd.enableGnomeKeyring = true; -#+end_src - -Close the desktop configuration. -#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes - } -#+end_src diff --git a/nixos/.flake/system/hardware-configuration.nix b/nixos/.flake/system/hardware-configuration.nix deleted file mode 100644 index 74ef301..0000000 --- a/nixos/.flake/system/hardware-configuration.nix +++ /dev/null @@ -1,41 +0,0 @@ -# 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" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/1cf884d2-8691-4122-85e2-a4edd2d1609f"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/ABCB-FAEC"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/675d8161-49c5-4348-9da5-4a7c8ada700f"; } - ]; - - # 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp10s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp9s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/nixos/.flake/system/locale.nix.org b/nixos/.flake/system/locale.nix.org deleted file mode 100644 index 63d05a0..0000000 --- a/nixos/.flake/system/locale.nix.org +++ /dev/null @@ -1,11 +0,0 @@ -#+title: Locale Setup - -My timezone is Winnipeg, and I use Canadian English. -#+begin_src nix :tangle ~/.flake/system/locale.nix :mkdirp yes - { config, lib, pkgs, ... }: - - { - time.timeZone = "America/Winnipeg"; - i18n.defaultLocale = "en_CA.UTF-8"; - } -#+end_src diff --git a/nixos/.flake/system/network.nix.org b/nixos/.flake/system/network.nix.org deleted file mode 100644 index 67a7721..0000000 --- a/nixos/.flake/system/network.nix.org +++ /dev/null @@ -1,55 +0,0 @@ -#+title: Network Configuration - -Open the network configuration. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - { config, lib, pkgs, ... }: - - { -#+end_src - -This system is called =nixos=. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - networking.hostName = "nixos"; -#+end_src - -I use NetworkManager to configure my network. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - networking.networkmanager.enable = true; -#+end_src - -Enable Bluetooth at boot. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; - services.blueman.enable = true; -#+end_src - -Enable printing. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - services.printing.enable = true; -#+end_src - -Enable SSH. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - services.openssh.enable = true; -#+end_src - -Set up my firewall. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - networking.firewall = { - allowedTCPPorts = [ ]; - allowedUDPPorts = [ ]; - }; - - environment.etc = { - "openvpn/update-resolv-conf" = { - source = ./update-resolv-conf.sh; - mode = "0700"; - }; - }; -#+end_src - -Close the network configuration. -#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes - } -#+end_src diff --git a/nixos/.flake/system/update-resolv-conf.sh b/nixos/.flake/system/update-resolv-conf.sh deleted file mode 100644 index 16622a1..0000000 --- a/nixos/.flake/system/update-resolv-conf.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -# -# Parses DHCP options from openvpn to update resolv.conf -# To use set as 'up' and 'down' script in your openvpn *.conf: -# up /etc/openvpn/update-resolv-conf -# down /etc/openvpn/update-resolv-conf -# -# Used snippets of resolvconf script by Thomas Hood -# and Chris Hanson -# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. -# 07/2013 colin@daedrum.net Fixed intet name -# 05/2006 chlauber@bnc.ch -# -# Example envs set from openvpn: -# foreign_option_1='dhcp-option DNS 193.43.27.132' -# foreign_option_2='dhcp-option DNS 193.43.27.133' -# foreign_option_3='dhcp-option DOMAIN be.bnc.ch' -# foreign_option_4='dhcp-option DOMAIN-SEARCH bnc.local' - -## The 'type' builtins will look for file in $PATH variable, so we set the -## PATH below. You might need to directly set the path to 'resolvconf' -## manually if it still doesn't work, i.e. -## RESOLVCONF=/usr/sbin/resolvconf -export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin -RESOLVCONF=$(type -p resolvconf) - -case $script_type in - -up) - for optionname in ${!foreign_option_*} ; do - option="${!optionname}" - echo $option - part1=$(echo "$option" | cut -d " " -f 1) - if [ "$part1" == "dhcp-option" ] ; then - part2=$(echo "$option" | cut -d " " -f 2) - part3=$(echo "$option" | cut -d " " -f 3) - if [ "$part2" == "DNS" ] ; then - IF_DNS_NAMESERVERS="$IF_DNS_NAMESERVERS $part3" - fi - if [[ "$part2" == "DOMAIN" || "$part2" == "DOMAIN-SEARCH" ]] ; then - IF_DNS_SEARCH="$IF_DNS_SEARCH $part3" - fi - fi - done - R="" - if [ "$IF_DNS_SEARCH" ]; then - R="search " - for DS in $IF_DNS_SEARCH ; do - R="${R} $DS" - done - R="${R} -" - fi - - for NS in $IF_DNS_NAMESERVERS ; do - R="${R}nameserver $NS -" - done - #echo -n "$R" | $RESOLVCONF -x -p -a "${dev}" - echo -n "$R" | $RESOLVCONF -x -a "${dev}.inet" - ;; -down) - $RESOLVCONF -d "${dev}.inet" - ;; -esac - -# Workaround / jm@epiclabs.io -# force exit with no errors. Due to an apparent conflict with the Network Manager -# $RESOLVCONF sometimes exits with error code 6 even though it has performed the -# action correctly and OpenVPN shuts down. -exit 0 diff --git a/nixos/.flake/system/users.nix.org b/nixos/.flake/system/users.nix.org deleted file mode 100644 index e922d8e..0000000 --- a/nixos/.flake/system/users.nix.org +++ /dev/null @@ -1,14 +0,0 @@ -#+title: User Configuration - -Set up my user account with =zsh= as default shell with =sudoers= and network management permissions. -#+begin_src nix -{ config, lib, pkgs, ... }: - -{ - users.users.jjanzen = { - shell = pkgs.zsh; - isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" ]; - }; -} -#+end_src diff --git a/nixos/flake/flake.lock b/nixos/flake/flake.lock new file mode 100644 index 0000000..1653154 --- /dev/null +++ b/nixos/flake/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1727383923, + "narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ffe2d07e771580a005e675108212597e5b367d2d", + "type": "github" + }, + "original": { + "id": "home-manager", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1726937504, + "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9357f4f23713673f310988025d9dc261c20e70c6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1727634051, + "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixos/flake/flake.nix.org b/nixos/flake/flake.nix.org new file mode 100644 index 0000000..c8ee8dd --- /dev/null +++ b/nixos/flake/flake.nix.org @@ -0,0 +1,34 @@ +#+title: Flake Root + +I use the unstable branch of =nixpkgs=. This file defines the outputs for my configuration (system and home). +#+begin_src nix + { + description = "My NixOS Configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + home-manager, + ... + }@inputs: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./system/core.nix + home-manager.nixosModules.home-manager + { + home-manager.backupFileExtension = "bak"; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.jjanzen = import ./home/core.nix; + } + ]; + }; + }; + } +#+end_src diff --git a/nixos/flake/home/.wallpaper b/nixos/flake/home/.wallpaper new file mode 120000 index 0000000..316db81 --- /dev/null +++ b/nixos/flake/home/.wallpaper @@ -0,0 +1 @@ +../../../common/.wallpaper \ No newline at end of file diff --git a/nixos/flake/home/clang-format.nix.org b/nixos/flake/home/clang-format.nix.org new file mode 120000 index 0000000..db7166a --- /dev/null +++ b/nixos/flake/home/clang-format.nix.org @@ -0,0 +1 @@ +../../../common/.flake/home/clang-format.nix.org \ No newline at end of file diff --git a/nixos/flake/home/core.nix.org b/nixos/flake/home/core.nix.org new file mode 100644 index 0000000..ec135d3 --- /dev/null +++ b/nixos/flake/home/core.nix.org @@ -0,0 +1,25 @@ +#+title: Core Home Configuration + +Set up home manager for my user account and import submodules. +#+begin_src nix :tangle ~/.flake/home/core.nix :mkdirp yes + { config, pkgs, ... }: + + { + imports = [ + ./clang-format.nix + ./cursor.nix + ./fonts.nix + ./hyprland.nix + ./programs/core.nix + ./scripts.nix + ./services/core.nix + ]; + + home.username = "jjanzen"; + home.homeDirectory = "/home/jjanzen"; + home.file.".wallpaper".source = ./.wallpaper; + + home.stateVersion = "24.05"; + programs.home-manager.enable = true; + } +#+end_src diff --git a/nixos/flake/home/cursor.nix.org b/nixos/flake/home/cursor.nix.org new file mode 120000 index 0000000..3d3d406 --- /dev/null +++ b/nixos/flake/home/cursor.nix.org @@ -0,0 +1 @@ +../../../common/.flake/home/cursor.nix.org \ No newline at end of file diff --git a/nixos/flake/home/fonts.nix.org b/nixos/flake/home/fonts.nix.org new file mode 120000 index 0000000..53bec1c --- /dev/null +++ b/nixos/flake/home/fonts.nix.org @@ -0,0 +1 @@ +../../../common/.flake/home/fonts.nix.org \ No newline at end of file diff --git a/nixos/flake/home/hyprland.nix.org b/nixos/flake/home/hyprland.nix.org new file mode 120000 index 0000000..d2a0693 --- /dev/null +++ b/nixos/flake/home/hyprland.nix.org @@ -0,0 +1 @@ +../../../common/.flake/home/hyprland.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/core.nix.org b/nixos/flake/home/programs/core.nix.org new file mode 100644 index 0000000..9557c8b --- /dev/null +++ b/nixos/flake/home/programs/core.nix.org @@ -0,0 +1,52 @@ +#+title: Core Program Configuration + +This is the core of my program configuration. This file installs programs that do not require additional configuration. Note that Discord is not FOSS and that =prismlauncher= is a launcher for Minecraft. +#+begin_src nix :tangle ~/.flake/home/programs/core.nix :mkdirp yes + { config, pkgs, ... }: + + { + imports = [ + ./emacs/core.nix + ./fastfetch.nix + ./foot.nix + ./git.nix + ./hyprlock.nix + ./ncmpcpp.nix + ./neovim.nix + ./ssh.nix + ./waybar.nix + ./zsh.nix + ]; + + home.packages = with pkgs; [ + discord # not FOSS + clang-tools + eza + fuzzel + ispell + gcc + gzdoom + htop + hyfetch + hyprshot + lesspipe + mpc-cli + mpv + networkmanagerapplet + obs-studio + openresolv + openvpn + pavucontrol + prismlauncher # minecraft + python3 + python312Packages.python-lsp-server + qbittorrent + retroarchFull + swaybg + texliveFull + unzip + zip + zotero + ]; + } +#+end_src diff --git a/nixos/flake/home/programs/emacs b/nixos/flake/home/programs/emacs new file mode 120000 index 0000000..39d7462 --- /dev/null +++ b/nixos/flake/home/programs/emacs @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/emacs \ No newline at end of file diff --git a/nixos/flake/home/programs/fastfetch.nix.org b/nixos/flake/home/programs/fastfetch.nix.org new file mode 120000 index 0000000..25e2716 --- /dev/null +++ b/nixos/flake/home/programs/fastfetch.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/fastfetch.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/foot.nix.org b/nixos/flake/home/programs/foot.nix.org new file mode 120000 index 0000000..6197c4a --- /dev/null +++ b/nixos/flake/home/programs/foot.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/foot.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/git.nix.org b/nixos/flake/home/programs/git.nix.org new file mode 120000 index 0000000..e8ddd28 --- /dev/null +++ b/nixos/flake/home/programs/git.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/git.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/hyprlock.nix.org b/nixos/flake/home/programs/hyprlock.nix.org new file mode 120000 index 0000000..7a25ac8 --- /dev/null +++ b/nixos/flake/home/programs/hyprlock.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/hyprlock.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/ncmpcpp.nix.org b/nixos/flake/home/programs/ncmpcpp.nix.org new file mode 120000 index 0000000..f91dfd3 --- /dev/null +++ b/nixos/flake/home/programs/ncmpcpp.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/ncmpcpp.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/neovim.nix.org b/nixos/flake/home/programs/neovim.nix.org new file mode 120000 index 0000000..871eafa --- /dev/null +++ b/nixos/flake/home/programs/neovim.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/neovim.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/ssh.nix.org b/nixos/flake/home/programs/ssh.nix.org new file mode 120000 index 0000000..363ead0 --- /dev/null +++ b/nixos/flake/home/programs/ssh.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/ssh.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/waybar.nix.org b/nixos/flake/home/programs/waybar.nix.org new file mode 120000 index 0000000..04d9dd3 --- /dev/null +++ b/nixos/flake/home/programs/waybar.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/waybar.nix.org \ No newline at end of file diff --git a/nixos/flake/home/programs/zsh.nix.org b/nixos/flake/home/programs/zsh.nix.org new file mode 120000 index 0000000..59d4ec7 --- /dev/null +++ b/nixos/flake/home/programs/zsh.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/programs/zsh.nix.org \ No newline at end of file diff --git a/nixos/flake/home/scripts.nix.org b/nixos/flake/home/scripts.nix.org new file mode 100644 index 0000000..b98b389 --- /dev/null +++ b/nixos/flake/home/scripts.nix.org @@ -0,0 +1,43 @@ +#+title: Custom Scripts + +Open script container. +#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes + { config, pkgs, ... }: + + { + home.file = { +#+end_src + +Use =fuzzel= to open a menu to power off, reboot, or log out. +#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes + ".local/bin/poweroptions.sh" = { + text = '' + #!/bin/sh + + getoption () { + fuzzel --dmenu -l 3 -x 1 -r 10 << EOF + 󰐥 power off + 󰜉 restart + 󰍃 logout + EOF + } + + option=$(getoption | xargs) + case $option in + '󰐥 power off') + systemctl poweroff;; + '󰜉 restart') + systemctl reboot;; + '󰍃 logout') + hyprctl dispatch exit;; + esac + ''; + executable = true; + }; +#+end_src + +Close script container. +#+begin_src nix :tangle ~/.flake/home/scripts.nix :mkdirp yes + }; + } +#+end_src diff --git a/nixos/flake/home/services/core.nix.org b/nixos/flake/home/services/core.nix.org new file mode 100644 index 0000000..7fbc333 --- /dev/null +++ b/nixos/flake/home/services/core.nix.org @@ -0,0 +1,19 @@ +#+title: Core Service Configuration + +Import service configurations. +#+begin_src nix :tangle ~/.flake/home/services/core.nix :mkdirp yes + { config, pkgs, ... }: + + { + imports = [ + ./emacs.nix + ./mako.nix + ./mpd.nix + ./syncthing.nix + ]; + + home.packages = with pkgs; [ + mpdscribble + ]; + } +#+end_src diff --git a/nixos/flake/home/services/emacs.nix.org b/nixos/flake/home/services/emacs.nix.org new file mode 120000 index 0000000..45c44ee --- /dev/null +++ b/nixos/flake/home/services/emacs.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/services/emacs.nix.org \ No newline at end of file diff --git a/nixos/flake/home/services/mako.nix.org b/nixos/flake/home/services/mako.nix.org new file mode 120000 index 0000000..b4d7e40 --- /dev/null +++ b/nixos/flake/home/services/mako.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/services/mako.nix.org \ No newline at end of file diff --git a/nixos/flake/home/services/mpd.nix.org b/nixos/flake/home/services/mpd.nix.org new file mode 120000 index 0000000..4b76825 --- /dev/null +++ b/nixos/flake/home/services/mpd.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/services/mpd.nix.org \ No newline at end of file diff --git a/nixos/flake/home/services/syncthing.nix.org b/nixos/flake/home/services/syncthing.nix.org new file mode 120000 index 0000000..8d42514 --- /dev/null +++ b/nixos/flake/home/services/syncthing.nix.org @@ -0,0 +1 @@ +../../../../common/.flake/home/services/syncthing.nix.org \ No newline at end of file diff --git a/nixos/flake/system/boot.nix.org b/nixos/flake/system/boot.nix.org new file mode 100644 index 0000000..fe98542 --- /dev/null +++ b/nixos/flake/system/boot.nix.org @@ -0,0 +1,11 @@ +#+title: Boot Configuration + +Enable =systemd-boot= as my boot loader. +#+begin_src nix :tangle ~/.flake/system/boot.nix :mkdirp yes +{ config, lib, pkgs, ... }: + +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} +#+end_src diff --git a/nixos/flake/system/core.nix.org b/nixos/flake/system/core.nix.org new file mode 100644 index 0000000..e909198 --- /dev/null +++ b/nixos/flake/system/core.nix.org @@ -0,0 +1,21 @@ +#+title: System Core + +This file imports various system configuration components in addition to enabling flakes and defining the system version. +#+begin_src nix :tangle ~/.flake/system/core.nix :mkdirp yes +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./boot.nix + ./desktop.nix + ./hardware-configuration.nix + ./locale.nix + ./network.nix + ./users.nix + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + system.stateVersion = "24.05"; +} +#+end_src diff --git a/nixos/flake/system/desktop.nix.org b/nixos/flake/system/desktop.nix.org new file mode 100644 index 0000000..eef6eef --- /dev/null +++ b/nixos/flake/system/desktop.nix.org @@ -0,0 +1,116 @@ +#+title: Desktop System Configuration + +Open the desktop configuration. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + { config, lib, pkgs, ... }: + + { +#+end_src + +Allow unfree packages on this system. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + nixpkgs.config.allowUnfree = true; +#+end_src + +Install necessary packages for the desktop. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + environment.systemPackages = with pkgs; [ + dolphin + firefox + git + greetd.tuigreet + kitty + gnumake + neovim + python3 + wget + ]; +#+end_src + +Install Steam. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; +#+end_src + +Use Neovim as my default editor. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + environment.variables.EDITOR = "nvim"; +#+end_src + +Enable GPG agent globally. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; +#+end_src + +Install =zsh= and set up completions. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + programs.zsh.enable = true; + environment.pathsToLink = [ "/share/zsh" ]; +#+end_src + +Use the =us= keyboard layout. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + services.xserver.xkb.layout = "us"; +#+end_src + +Install Hyprland as a window manager. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + services.xserver.enable = true; + xdg.portal.enable = true; + programs.hyprland.enable = true; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; +#+end_src + +Enable =pam= support for Hyprlock. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + security.pam.services.hyprlock = {}; +#+end_src + +Enable =greetd= with =tuigreet= as my login manager. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session --sessions ${pkgs.hyprland}/share/wayland-sessions --cmd \"dbus-run-session Hyprland\""; + user = "greeter"; + }; + }; + }; + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StanardOutput = "tty"; + StandardError = "journal"; + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; +#+end_src + +Enable PipeWire. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + services.pipewire = { + enable = true; + pulse.enable = true; + }; +#+end_src + +Enable GNOME Keyring. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + services.gnome.gnome-keyring.enable = true; + security.pam.services.greetd.enableGnomeKeyring = true; +#+end_src + +Close the desktop configuration. +#+begin_src nix :tangle ~/.flake/system/desktop.nix :mkdirp yes + } +#+end_src diff --git a/nixos/flake/system/hardware-configuration.nix b/nixos/flake/system/hardware-configuration.nix new file mode 100644 index 0000000..74ef301 --- /dev/null +++ b/nixos/flake/system/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1cf884d2-8691-4122-85e2-a4edd2d1609f"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/ABCB-FAEC"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/675d8161-49c5-4348-9da5-4a7c8ada700f"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp10s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp9s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/flake/system/locale.nix.org b/nixos/flake/system/locale.nix.org new file mode 100644 index 0000000..63d05a0 --- /dev/null +++ b/nixos/flake/system/locale.nix.org @@ -0,0 +1,11 @@ +#+title: Locale Setup + +My timezone is Winnipeg, and I use Canadian English. +#+begin_src nix :tangle ~/.flake/system/locale.nix :mkdirp yes + { config, lib, pkgs, ... }: + + { + time.timeZone = "America/Winnipeg"; + i18n.defaultLocale = "en_CA.UTF-8"; + } +#+end_src diff --git a/nixos/flake/system/network.nix.org b/nixos/flake/system/network.nix.org new file mode 100644 index 0000000..67a7721 --- /dev/null +++ b/nixos/flake/system/network.nix.org @@ -0,0 +1,55 @@ +#+title: Network Configuration + +Open the network configuration. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + { config, lib, pkgs, ... }: + + { +#+end_src + +This system is called =nixos=. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + networking.hostName = "nixos"; +#+end_src + +I use NetworkManager to configure my network. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + networking.networkmanager.enable = true; +#+end_src + +Enable Bluetooth at boot. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + services.blueman.enable = true; +#+end_src + +Enable printing. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + services.printing.enable = true; +#+end_src + +Enable SSH. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + services.openssh.enable = true; +#+end_src + +Set up my firewall. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + networking.firewall = { + allowedTCPPorts = [ ]; + allowedUDPPorts = [ ]; + }; + + environment.etc = { + "openvpn/update-resolv-conf" = { + source = ./update-resolv-conf.sh; + mode = "0700"; + }; + }; +#+end_src + +Close the network configuration. +#+begin_src nix :tangle ~/.flake/system/network.nix :mkdirp yes + } +#+end_src diff --git a/nixos/flake/system/update-resolv-conf.sh b/nixos/flake/system/update-resolv-conf.sh new file mode 100644 index 0000000..16622a1 --- /dev/null +++ b/nixos/flake/system/update-resolv-conf.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# +# Parses DHCP options from openvpn to update resolv.conf +# To use set as 'up' and 'down' script in your openvpn *.conf: +# up /etc/openvpn/update-resolv-conf +# down /etc/openvpn/update-resolv-conf +# +# Used snippets of resolvconf script by Thomas Hood +# and Chris Hanson +# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. +# 07/2013 colin@daedrum.net Fixed intet name +# 05/2006 chlauber@bnc.ch +# +# Example envs set from openvpn: +# foreign_option_1='dhcp-option DNS 193.43.27.132' +# foreign_option_2='dhcp-option DNS 193.43.27.133' +# foreign_option_3='dhcp-option DOMAIN be.bnc.ch' +# foreign_option_4='dhcp-option DOMAIN-SEARCH bnc.local' + +## The 'type' builtins will look for file in $PATH variable, so we set the +## PATH below. You might need to directly set the path to 'resolvconf' +## manually if it still doesn't work, i.e. +## RESOLVCONF=/usr/sbin/resolvconf +export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin +RESOLVCONF=$(type -p resolvconf) + +case $script_type in + +up) + for optionname in ${!foreign_option_*} ; do + option="${!optionname}" + echo $option + part1=$(echo "$option" | cut -d " " -f 1) + if [ "$part1" == "dhcp-option" ] ; then + part2=$(echo "$option" | cut -d " " -f 2) + part3=$(echo "$option" | cut -d " " -f 3) + if [ "$part2" == "DNS" ] ; then + IF_DNS_NAMESERVERS="$IF_DNS_NAMESERVERS $part3" + fi + if [[ "$part2" == "DOMAIN" || "$part2" == "DOMAIN-SEARCH" ]] ; then + IF_DNS_SEARCH="$IF_DNS_SEARCH $part3" + fi + fi + done + R="" + if [ "$IF_DNS_SEARCH" ]; then + R="search " + for DS in $IF_DNS_SEARCH ; do + R="${R} $DS" + done + R="${R} +" + fi + + for NS in $IF_DNS_NAMESERVERS ; do + R="${R}nameserver $NS +" + done + #echo -n "$R" | $RESOLVCONF -x -p -a "${dev}" + echo -n "$R" | $RESOLVCONF -x -a "${dev}.inet" + ;; +down) + $RESOLVCONF -d "${dev}.inet" + ;; +esac + +# Workaround / jm@epiclabs.io +# force exit with no errors. Due to an apparent conflict with the Network Manager +# $RESOLVCONF sometimes exits with error code 6 even though it has performed the +# action correctly and OpenVPN shuts down. +exit 0 diff --git a/nixos/flake/system/users.nix.org b/nixos/flake/system/users.nix.org new file mode 100644 index 0000000..e922d8e --- /dev/null +++ b/nixos/flake/system/users.nix.org @@ -0,0 +1,14 @@ +#+title: User Configuration + +Set up my user account with =zsh= as default shell with =sudoers= and network management permissions. +#+begin_src nix +{ config, lib, pkgs, ... }: + +{ + users.users.jjanzen = { + shell = pkgs.zsh; + isNormalUser = true; + extraGroups = [ "networkmanager" "wheel" ]; + }; +} +#+end_src -- cgit v1.2.3