diff --git a/disko.nix b/disko/default.nix similarity index 83% rename from disko.nix rename to disko/default.nix index 8e88f75..092f705 100644 --- a/disko.nix +++ b/disko/default.nix @@ -1,5 +1,5 @@ { - standard = { disks ? [ "/dev/vda" ], ... }: { + standard = {disks ? ["/dev/vda"], ...}: { # this is my standard partitioning scheme for my machines: an LUKS-encrypted # btrfs volume disko.devices = { @@ -29,7 +29,7 @@ content = { type = "luks"; name = "crypted"; - extraOpenArgs = [ "--allow-discards" ]; + extraOpenArgs = ["--allow-discards"]; # if you want to use the key for interactive login be sure there is no trailing newline # for example use `echo -n "password" > /tmp/secret.key` keyFile = "/tmp/secret.key"; # Interactive @@ -37,19 +37,19 @@ # additionalKeyFiles = ["/tmp/additionalSecret.key"]; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "/home" = { mountpoint = "/home"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "/nix" = { mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; }; }; @@ -62,7 +62,7 @@ }; }; # TODO: figure out what I can't have an optiona/default 'name' attribute here so I can DRY with "standard" - thinker = { disks ? [ "/dev/vda" ], ... }: { + thinker = {disks ? ["/dev/vda"], ...}: { # this is my standard partitioning scheme for my machines: an LUKS-encrypted # btrfs volume disko.devices = { @@ -92,7 +92,7 @@ content = { type = "luks"; name = "crypted"; - extraOpenArgs = [ "--allow-discards" ]; + extraOpenArgs = ["--allow-discards"]; # if you want to use the key for interactive login be sure there is no trailing newline # for example use `echo -n "password" > /tmp/secret.key` keyFile = "/tmp/secret.key"; # Interactive @@ -100,19 +100,19 @@ # additionalKeyFiles = ["/tmp/additionalSecret.key"]; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "/home" = { mountpoint = "/home"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "/nix" = { mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; }; }; @@ -124,7 +124,7 @@ }; }; }; - unencrypted = { disks ? [ "/dev/vda" ], ... }: { + unencrypted = {disks ? ["/dev/vda"], ...}: { disko.devices = { disk = { primary = { @@ -151,19 +151,19 @@ size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "/root" = { mountpoint = "/"; - mountOptions = [ ]; + mountOptions = []; }; "/home" = { mountpoint = "/home"; - mountOptions = [ "compress=zstd" ]; + mountOptions = ["compress=zstd"]; }; "/nix" = { mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; }; }; diff --git a/flake.lock b/flake.lock index 5e315c2..e12422d 100644 --- a/flake.lock +++ b/flake.lock @@ -120,21 +120,6 @@ "type": "github" } }, - "flake-utils_3": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "helix": { "inputs": { "crane": "crane", @@ -164,15 +149,16 @@ ] }, "locked": { - "lastModified": 1696145345, - "narHash": "sha256-3dM7I/d4751SLPJah0to1WBlWiyzIiuCEUwJqwBdmr4=", + "lastModified": 1695108154, + "narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", "owner": "nix-community", "repo": "home-manager", - "rev": "6f9b5b83ad1f470b3d11b8a9fe1d5ef68c7d0e30", + "rev": "07682fff75d41f18327a871088d20af2710d4744", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-23.05", "repo": "home-manager", "type": "github" } @@ -209,6 +195,22 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1696125185, @@ -243,15 +245,16 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1696275311, - "narHash": "sha256-Z8aJvoUyMv/+0G7iqYIqecxRDFbz05RK2e3/irbWq9M=", - "owner": "NixOS", + "lastModified": 1696039360, + "narHash": "sha256-g7nIUV4uq1TOVeVIDEZLb005suTWCUjSY0zYOlSBsyE=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "828ba8482b64704adad28786355ed8a45d59eb0a", + "rev": "32dcb45f66c0487e92db8303a798ebc548cadedc", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } @@ -279,8 +282,8 @@ "helix": "helix", "home-manager": "home-manager", "nixpkgs": "nixpkgs_4", - "sops-nix": "sops-nix", - "utils": "utils" + "nixpkgs-unstable": "nixpkgs-unstable", + "sops-nix": "sops-nix" } }, "rust-overlay": { @@ -356,24 +359,6 @@ "repo": "default", "type": "github" } - }, - "utils": { - "inputs": { - "flake-utils": "flake-utils_3" - }, - "locked": { - "lastModified": 1696272629, - "narHash": "sha256-KprLE/cqg5PFNT1PKQRjE/bJpr4AlgedoUPO/4jee+8=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "2893fcad90dcc2ac2265c227b5444a7cd7ef21f0", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index acd0824..63f6f88 100644 --- a/flake.nix +++ b/flake.nix @@ -1,26 +1,92 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; - # nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-channels/nixos-unstable"; - api-lyte-dev.url = "git+ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - # inputs.utils.follows = "utils"; - }; + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + home-manager.url = "github:nix-community/home-manager/release-23.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b"; disko.url = "github:nix-community/disko/master"; sops-nix.url = "github:Mic92/sops-nix"; - helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b"; + + # TODO: do I really need this in the root of my flake if _only_ beefcake uses it? + api-lyte-dev.url = "git+ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git"; + + # TODO: hardware.url = "github:nixos/nixos-hardware"; # might be useful for laptops # TODO: hyprland.url = "github:hyprwm/Hyprland"; + # TODO: nix-colors.url = "github:misterio77/nix-colors"; }; - outputs = inputs @ { self, ... }: { - diskoConfigurations = import ./disko.nix; - homeConfigurations = import ./home.nix inputs; - nixosConfigurations = import ./nixos.nix inputs; + outputs = { + self, + nixpkgs, + home-manager, + ... + } @ inputs: let + inherit (self) outputs; + + systems = [ + "aarch64-linux" + # "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + + forAllSystems = nixpkgs.lib.genAttrs systems; + in { + # Your custom packages + # Acessible through 'nix build', 'nix shell', etc + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + + # Formatter for your nix files, available through 'nix fmt' + # Other options beside 'alejandra' include 'nixpkgs-fmt' + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + + # Your custom packages and modifications, exported as overlays + overlays = import ./overlays {inherit inputs;}; + + # Reusable nixos modules you might want to export + # These are usually stuff you would upstream into nixpkgs + nixosModules = import ./modules/nixos; + + # Reusable home-manager modules you might want to export + # These are usually stuff you would upstream into home-manager + homeManagerModules = import ./modules/home-manager; + + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#your-hostname' + nixosConfigurations = { + dragon = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./nixos/dragon + ]; + }; + }; + + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#your-username@your-hostname' + homeConfigurations = { + "daniel@lyte.dev" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [./home-manager/home.nix]; + }; + + "daniel.flanagan@hq.bill.com" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.aarch64-darwin; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [./home-manager/home.nix]; + }; + }; + # TODO: darwin for work? # TODO: nixos ISO? + + # Disk partition schemes and functions + diskoConfigurations = import ./disko.nix; }; } diff --git a/home.nix b/home.nix deleted file mode 100644 index 3a79293..0000000 --- a/home.nix +++ /dev/null @@ -1,25 +0,0 @@ -inputs: -let - mkHome = system: modules: - let - overlay = final: prev: { - helix = prev.helix // inputs.helix.packages.${system}.helix; - }; - pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; }; - in - inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ] ++ modules; - }; -in -{ - daniel = mkHome "x86_64-linux" [ - ./home/user.nix - ./home/linux.nix - ]; - - daniel-work = mkHome "aarch64-darwin" [ - ./home/user.nix - ./home/work.nix - ]; -} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..626ef85 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,25 @@ +inputs: let + mkHome = system: modules: let + overlay = final: prev: { + helix = prev.helix // inputs.helix.packages.${system}.helix; + }; + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [overlay]; + }; + in + inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [] ++ modules; + }; +in { + daniel = mkHome "x86_64-linux" [ + ./home/user.nix + ./home/linux.nix + ]; + + daniel-work = mkHome "aarch64-darwin" [ + ./home/user.nix + ./home/work.nix + ]; +} diff --git a/fish/interactiveShellInit.fish b/home/fish/interactiveShellInit.fish similarity index 100% rename from fish/interactiveShellInit.fish rename to home/fish/interactiveShellInit.fish diff --git a/fish/shellInit.fish b/home/fish/shellInit.fish similarity index 100% rename from fish/shellInit.fish rename to home/fish/shellInit.fish diff --git a/home/user.nix b/home/home.nix similarity index 92% rename from home/user.nix rename to home/home.nix index 8e5b06c..03118d2 100644 --- a/home/user.nix +++ b/home/home.nix @@ -1,9 +1,11 @@ -{ pkgs, lib, ... }: -let +{ + pkgs, + lib, + ... +}: let email = "daniel@lyte.dev"; name = "Daniel Flanagan"; -in -{ +in { # TODO: email access? # accounts.email.accounts = { # google = { @@ -36,7 +38,10 @@ in pkgs.nixpkgs-fmt # TODO: os-specific scripts? macOS versus Linux (arch or nixos? do I need to distinguish at that point?) - (pkgs.buildEnv { name = "my-scripts-common"; paths = [ ../scripts/common ]; }) + (pkgs.buildEnv { + name = "my-scripts-common"; + paths = [../scripts/common]; + }) ]; file = { @@ -79,7 +84,7 @@ in programs = { password-store = { enable = true; - package = (pkgs.pass.withExtensions (exts: [ exts.pass-otp ])); + package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); }; git = { @@ -90,7 +95,7 @@ in delta = { enable = true; - options = { }; + options = {}; }; lfs = { @@ -161,25 +166,29 @@ in language-server = { lexical = { command = "lexical"; - args = [ "start" ]; + args = ["start"]; }; next-ls = { command = "next-ls"; - args = [ "--stdout" ]; + args = ["--stdout"]; }; deno = { command = "deno"; - args = [ "lsp" ]; - config = { enable = true; lint = true; unstable = true; }; + args = ["lsp"]; + config = { + enable = true; + lint = true; + unstable = true; + }; }; }; language = [ { name = "elixir"; - language-servers = [ "elixir-ls" ]; # "lexical" "next-ls" + language-servers = ["elixir-ls"]; # "lexical" "next-ls" auto-format = true; } { @@ -191,7 +200,7 @@ in auto-format = true; formatter = { command = "nixpkgs-fmt"; - args = [ ]; + args = []; }; } { @@ -209,13 +218,13 @@ in grammar = "javascript"; scope = "source.js"; injection-regex = "^(js|javascript)$"; - file-types = [ "js" "mjs" ]; - shebangs = [ "deno" ]; - language-servers = [ "deno" ]; - roots = [ "deno.jsonc" "deno.json" ]; + file-types = ["js" "mjs"]; + shebangs = ["deno"]; + language-servers = ["deno"]; + roots = ["deno.jsonc" "deno.json"]; formatter = { command = "deno"; - args = [ "fmt" ]; + args = ["fmt"]; }; auto-format = true; comment-token = "//"; @@ -231,13 +240,13 @@ in grammar = "typescript"; scope = "source.ts"; injection-regex = "^(ts|typescript)$"; - file-types = [ "ts" ]; - shebangs = [ "deno" ]; - language-servers = [ "deno" ]; - roots = [ "deno.jsonc" "deno.json" ]; + file-types = ["ts"]; + shebangs = ["deno"]; + language-servers = ["deno"]; + roots = ["deno.jsonc" "deno.json"]; formatter = { command = "deno"; - args = [ "fmt" ]; + args = ["fmt"]; }; auto-format = true; comment-token = "//"; @@ -253,10 +262,13 @@ in grammar = "jsonc"; scope = "source.jsonc"; injection-regex = "^(jsonc)$"; - roots = [ "deno.jsonc" "deno.json" ]; - file-types = [ "jsonc" ]; - language-servers = [ "deno" ]; - indent = { tab-width = 2; unit = " "; }; + roots = ["deno.jsonc" "deno.json"]; + file-types = ["jsonc"]; + language-servers = ["deno"]; + indent = { + tab-width = 2; + unit = " "; + }; auto-format = true; } @@ -311,7 +323,7 @@ in color-modes = false; bufferline = "multiple"; scrolloff = 8; - rulers = [ 80 120 ]; + rulers = [80 120]; cursorline = true; cursor-shape = { @@ -331,16 +343,19 @@ in display-inlay-hints = true; }; statusline = { - left = [ "mode" "spinner" "selections" "primary-selection-length" "position" "position-percentage" "diagnostics" "workspace-diagnostics" ]; - center = [ "file-name" ]; - right = [ "version-control" "total-line-numbers" "file-encoding" ]; + left = ["mode" "spinner" "selections" "primary-selection-length" "position" "position-percentage" "diagnostics" "workspace-diagnostics"]; + center = ["file-name"]; + right = ["version-control" "total-line-numbers" "file-encoding"]; }; - }; keys = { - insert = { - j = { k = "normal_mode"; j = "normal_mode"; K = "normal_mode"; J = "normal_mode"; }; + j = { + k = "normal_mode"; + j = "normal_mode"; + K = "normal_mode"; + J = "normal_mode"; + }; }; normal = { @@ -362,9 +377,11 @@ in }; }; - select = { - space = { q = ":reflow 80"; Q = ":reflow 120"; }; + space = { + q = ":reflow 80"; + Q = ":reflow 120"; + }; "L" = "repeat_last_motion"; }; }; @@ -406,13 +423,14 @@ in repo = "bat"; rev = "477622171ec0529505b0ca3cada68fc9433648c6"; sha256 = "6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw="; - } + "/Catppuccin-mocha.tmTheme"); + } + + "/Catppuccin-mocha.tmTheme"); }; }; kitty = { enable = true; - darwinLaunchOptions = [ "--single-instance" ]; + darwinLaunchOptions = ["--single-instance"]; shellIntegration = { enableFishIntegration = true; }; @@ -689,7 +707,11 @@ in }; verbs = [ - { invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}"; } + { + invocation = "edit"; + shortcut = "e"; + execution = "$EDITOR {file}"; + } ]; }; }; @@ -747,7 +769,7 @@ in has_command = "command --quiet --search $argv[1]"; }; - shellAbbrs = { }; + shellAbbrs = {}; shellAliases = { l = "br"; ls = "eza --group-directories-first --classify"; diff --git a/home/linux.nix b/home/linux.nix index 1955695..69e8f3c 100644 --- a/home/linux.nix +++ b/home/linux.nix @@ -1,4 +1,8 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + ... +}: { home.pointerCursor = { name = "Bibata-Modern-Classic"; package = pkgs.bibata-cursors; @@ -16,16 +20,39 @@ enable = true; events = [ - { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; } + { + event = "before-sleep"; + command = "${pkgs.swaylock}/bin/swaylock"; + } ]; timeouts = [ - { timeout = 330; command = "notify-send \"Idling in 300 seconds\""; resumeCommand = "notify-send \"Idling cancelled.\""; } - { timeout = 540; command = "notify-send \"Idling in 90 seconds\""; } - { timeout = 570; command = "notify-send \"Idling in 60 seconds\""; } - { timeout = 600; command = "notify-send \"Idling in 30 seconds...\""; } - { timeout = 630; command = "swaylock -f"; } - { timeout = 660; command = "swaymsg \"output * dpms off\""; resumeCommand = "swaymsg \"output * dpms on\" & maybe-good-morning &"; } + { + timeout = 330; + command = "notify-send \"Idling in 300 seconds\""; + resumeCommand = "notify-send \"Idling cancelled.\""; + } + { + timeout = 540; + command = "notify-send \"Idling in 90 seconds\""; + } + { + timeout = 570; + command = "notify-send \"Idling in 60 seconds\""; + } + { + timeout = 600; + command = "notify-send \"Idling in 30 seconds...\""; + } + { + timeout = 630; + command = "swaylock -f"; + } + { + timeout = 660; + command = "swaymsg \"output * dpms off\""; + resumeCommand = "swaymsg \"output * dpms on\" & maybe-good-morning &"; + } ]; }; }; @@ -38,16 +65,16 @@ # set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)" # for_window [title=".*"] floating enable # for_window [app_id=$tilers] floating disable - # + # # # for_window [title=".*"] opacity $opacity - # + # # client.focused #74c7ec #74c7ec #74c7ec #74c7ec #74c7ec # client.focused_inactive #100814 #100814 #9b9ebf #100814 #100814 # client.unfocused #100814 #100814 #9b9ebf #100814 #100814 - # + # # # TODO: I forget why I needed this - could google it I expect? # exec /usr/lib/polkit-kde-authentication-agent-1 - # + # # # prevent all windows from stealing focus # no_focus [class=".*"] @@ -88,10 +115,16 @@ }; startup = [ - { command = "systemctl --user restart waybar"; always = true; } - { command = "systemctl --user restart swayidle"; always = true; } - { command = "firefox"; } - { command = "kitty --single-instance"; } + { + command = "systemctl --user restart waybar"; + always = true; + } + { + command = "systemctl --user restart swayidle"; + always = true; + } + {command = "firefox";} + {command = "kitty --single-instance";} ]; modes = { @@ -128,11 +161,12 @@ tap = "enabled"; natural_scroll = "enabled"; middle_emulation = "enabled"; - # pointer_accel + # pointer_accel }; - }; - keybindings = let mod = config.wayland.windowManager.sway.config.modifier; in { + keybindings = let + mod = config.wayland.windowManager.sway.config.modifier; + in { # bindsym $mod+shift+space exec wofi --show drun "${mod}+control+space" = "exec makoctl dismiss"; "${mod}+shift+space" = "exec makoctl invoke"; @@ -237,9 +271,9 @@ "${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle"; }; - assigns = { }; - bars = [ ]; - colors = { }; + assigns = {}; + bars = []; + colors = {}; }; }; @@ -248,16 +282,19 @@ theme = { name = "Catppuccin-Mocha-Compact-Sapphire-dark"; package = pkgs.catppuccin-gtk.override { - accents = [ "sapphire" ]; + accents = ["sapphire"]; size = "compact"; - tweaks = [ "rimless" "black" ]; + tweaks = ["rimless" "black"]; variant = "mocha"; }; }; }; home.packages = [ - (pkgs.buildEnv { name = "my-linux-scripts"; paths = [ ../scripts/linux ]; }) + (pkgs.buildEnv { + name = "my-linux-scripts"; + paths = [../scripts/linux]; + }) ]; programs = { @@ -267,10 +304,10 @@ mainBar = { "layer" = "top"; "position" = "bottom"; - "output" = [ "eDP-1" "DP-3" ]; + "output" = ["eDP-1" "DP-3"]; "height" = 32; - "modules-left" = [ "clock" "sway/window" ]; - "modules-center" = [ "sway/workspaces" ]; + "modules-left" = ["clock" "sway/window"]; + "modules-center" = ["sway/workspaces"]; "modules-right" = [ "mpris" "idle_inhibitor" @@ -303,15 +340,15 @@ "sway/workspaces" = { "disable-scroll" = false; "persistent_workspaces" = { - "1" = [ ]; - "2" = [ ]; - "3" = [ ]; - "4" = [ ]; - "5" = [ ]; - "6" = [ ]; - "7" = [ ]; - "8" = [ ]; - "9" = [ ]; + "1" = []; + "2" = []; + "3" = []; + "4" = []; + "5" = []; + "6" = []; + "7" = []; + "8" = []; + "9" = []; # "10" = [; }; "all-outputs" = true; @@ -346,12 +383,12 @@ "critical-threshold" = 80; # "format-critical" = "{temperatureC}°C {icon}"; "format" = "{temperatureC}°C {icon}"; - "format-icons" = [ "" "" "" ]; + "format-icons" = ["" "" ""]; }; "backlight" = { # "device" = "acpi_video1"; "format" = "{percent}% {icon}"; - "format-icons" = [ "" "" ]; + "format-icons" = ["" ""]; }; "battery" = { "states" = { @@ -365,7 +402,7 @@ "format-alt" = "{time} {icon}"; "format-good" = ""; # An empty format will hide the modul; "format-full" = "󰁹"; - "format-icons" = [ "󰂎" "󰁻" "󰁽" "󰁿" "󰂂" ]; + "format-icons" = ["󰂎" "󰁻" "󰁽" "󰁿" "󰂂"]; }; "network" = { "format-wifi" = "{essid} ({signalStrength}%) "; @@ -394,7 +431,7 @@ "phone" = ""; "portable" = ""; "car" = ""; - "default" = [ "" "" "" ]; + "default" = ["" "" ""]; }; # TODO: toggle mute? "on-click" = "pavucontrol"; @@ -638,7 +675,6 @@ systemd = { enable = true; }; - }; firefox = { @@ -647,7 +683,7 @@ enable = true; # TODO: uses nixpkgs.pass so pass otp doesn't work - package = (pkgs.firefox.override { extraNativeMessagingHosts = [ pkgs.passff-host ]; }); + package = pkgs.firefox.override {extraNativeMessagingHosts = [pkgs.passff-host];}; # extensions = with pkgs.nur.repos.rycee.firefox-addons; [ # ublock-origin @@ -726,5 +762,3 @@ }; }; } - - diff --git a/scripts/common/bin/? b/home/scripts/common/bin/? similarity index 100% rename from scripts/common/bin/? rename to home/scripts/common/bin/? diff --git a/scripts/common/bin/N b/home/scripts/common/bin/N similarity index 100% rename from scripts/common/bin/N rename to home/scripts/common/bin/N diff --git a/scripts/common/bin/archive b/home/scripts/common/bin/archive similarity index 100% rename from scripts/common/bin/archive rename to home/scripts/common/bin/archive diff --git a/scripts/common/bin/archupdate b/home/scripts/common/bin/archupdate similarity index 100% rename from scripts/common/bin/archupdate rename to home/scripts/common/bin/archupdate diff --git a/scripts/common/bin/at b/home/scripts/common/bin/at similarity index 100% rename from scripts/common/bin/at rename to home/scripts/common/bin/at diff --git a/scripts/common/bin/bp b/home/scripts/common/bin/bp similarity index 100% rename from scripts/common/bin/bp rename to home/scripts/common/bin/bp diff --git a/scripts/common/bin/check-domain-availability b/home/scripts/common/bin/check-domain-availability similarity index 100% rename from scripts/common/bin/check-domain-availability rename to home/scripts/common/bin/check-domain-availability diff --git a/scripts/common/bin/check-port b/home/scripts/common/bin/check-port similarity index 100% rename from scripts/common/bin/check-port rename to home/scripts/common/bin/check-port diff --git a/scripts/common/bin/clip b/home/scripts/common/bin/clip similarity index 100% rename from scripts/common/bin/clip rename to home/scripts/common/bin/clip diff --git a/scripts/common/bin/clipshot b/home/scripts/common/bin/clipshot similarity index 100% rename from scripts/common/bin/clipshot rename to home/scripts/common/bin/clipshot diff --git a/scripts/common/bin/copy-git-forge-url b/home/scripts/common/bin/copy-git-forge-url similarity index 100% rename from scripts/common/bin/copy-git-forge-url rename to home/scripts/common/bin/copy-git-forge-url diff --git a/scripts/common/bin/countdown b/home/scripts/common/bin/countdown similarity index 100% rename from scripts/common/bin/countdown rename to home/scripts/common/bin/countdown diff --git a/scripts/common/bin/dns b/home/scripts/common/bin/dns similarity index 100% rename from scripts/common/bin/dns rename to home/scripts/common/bin/dns diff --git a/scripts/common/bin/dns-cleaner b/home/scripts/common/bin/dns-cleaner similarity index 100% rename from scripts/common/bin/dns-cleaner rename to home/scripts/common/bin/dns-cleaner diff --git a/scripts/common/bin/dns-deleter b/home/scripts/common/bin/dns-deleter similarity index 100% rename from scripts/common/bin/dns-deleter rename to home/scripts/common/bin/dns-deleter diff --git a/scripts/common/bin/dns-deleter-matching b/home/scripts/common/bin/dns-deleter-matching similarity index 100% rename from scripts/common/bin/dns-deleter-matching rename to home/scripts/common/bin/dns-deleter-matching diff --git a/scripts/common/bin/editscrot b/home/scripts/common/bin/editscrot similarity index 100% rename from scripts/common/bin/editscrot rename to home/scripts/common/bin/editscrot diff --git a/scripts/common/bin/email-via-mailgun-smtp b/home/scripts/common/bin/email-via-mailgun-smtp similarity index 100% rename from scripts/common/bin/email-via-mailgun-smtp rename to home/scripts/common/bin/email-via-mailgun-smtp diff --git a/scripts/common/bin/emoji b/home/scripts/common/bin/emoji similarity index 100% rename from scripts/common/bin/emoji rename to home/scripts/common/bin/emoji diff --git a/scripts/common/bin/ezln b/home/scripts/common/bin/ezln similarity index 100% rename from scripts/common/bin/ezln rename to home/scripts/common/bin/ezln diff --git a/scripts/common/bin/field b/home/scripts/common/bin/field similarity index 100% rename from scripts/common/bin/field rename to home/scripts/common/bin/field diff --git a/scripts/common/bin/getip b/home/scripts/common/bin/getip similarity index 100% rename from scripts/common/bin/getip rename to home/scripts/common/bin/getip diff --git a/scripts/common/bin/git-authors b/home/scripts/common/bin/git-authors similarity index 100% rename from scripts/common/bin/git-authors rename to home/scripts/common/bin/git-authors diff --git a/scripts/common/bin/gitforge-url.ts b/home/scripts/common/bin/gitforge-url.ts similarity index 100% rename from scripts/common/bin/gitforge-url.ts rename to home/scripts/common/bin/gitforge-url.ts diff --git a/scripts/common/bin/glancepath b/home/scripts/common/bin/glancepath similarity index 100% rename from scripts/common/bin/glancepath rename to home/scripts/common/bin/glancepath diff --git a/scripts/common/bin/good-morning b/home/scripts/common/bin/good-morning similarity index 100% rename from scripts/common/bin/good-morning rename to home/scripts/common/bin/good-morning diff --git a/scripts/common/bin/has_command b/home/scripts/common/bin/has_command similarity index 100% rename from scripts/common/bin/has_command rename to home/scripts/common/bin/has_command diff --git a/scripts/common/bin/is_wayland b/home/scripts/common/bin/is_wayland similarity index 100% rename from scripts/common/bin/is_wayland rename to home/scripts/common/bin/is_wayland diff --git a/scripts/common/bin/k8s-yaml-diff b/home/scripts/common/bin/k8s-yaml-diff similarity index 100% rename from scripts/common/bin/k8s-yaml-diff rename to home/scripts/common/bin/k8s-yaml-diff diff --git a/scripts/common/bin/k8s-yaml-sort b/home/scripts/common/bin/k8s-yaml-sort similarity index 100% rename from scripts/common/bin/k8s-yaml-sort rename to home/scripts/common/bin/k8s-yaml-sort diff --git a/scripts/common/bin/keyrepeat b/home/scripts/common/bin/keyrepeat similarity index 100% rename from scripts/common/bin/keyrepeat rename to home/scripts/common/bin/keyrepeat diff --git a/scripts/common/bin/kubeline b/home/scripts/common/bin/kubeline similarity index 100% rename from scripts/common/bin/kubeline rename to home/scripts/common/bin/kubeline diff --git a/scripts/common/bin/kubfc b/home/scripts/common/bin/kubfc similarity index 100% rename from scripts/common/bin/kubfc rename to home/scripts/common/bin/kubfc diff --git a/scripts/common/bin/kubfn b/home/scripts/common/bin/kubfn similarity index 100% rename from scripts/common/bin/kubfn rename to home/scripts/common/bin/kubfn diff --git a/scripts/common/bin/launch b/home/scripts/common/bin/launch similarity index 100% rename from scripts/common/bin/launch rename to home/scripts/common/bin/launch diff --git a/scripts/common/bin/linewise b/home/scripts/common/bin/linewise similarity index 100% rename from scripts/common/bin/linewise rename to home/scripts/common/bin/linewise diff --git a/scripts/common/bin/maybe_source_env_file b/home/scripts/common/bin/maybe_source_env_file similarity index 100% rename from scripts/common/bin/maybe_source_env_file rename to home/scripts/common/bin/maybe_source_env_file diff --git a/scripts/common/bin/nd b/home/scripts/common/bin/nd similarity index 100% rename from scripts/common/bin/nd rename to home/scripts/common/bin/nd diff --git a/scripts/common/bin/nf b/home/scripts/common/bin/nf similarity index 100% rename from scripts/common/bin/nf rename to home/scripts/common/bin/nf diff --git a/scripts/common/bin/note b/home/scripts/common/bin/note similarity index 100% rename from scripts/common/bin/note rename to home/scripts/common/bin/note diff --git a/scripts/common/bin/nsync b/home/scripts/common/bin/nsync similarity index 100% rename from scripts/common/bin/nsync rename to home/scripts/common/bin/nsync diff --git a/scripts/common/bin/nvimdiff b/home/scripts/common/bin/nvimdiff similarity index 100% rename from scripts/common/bin/nvimdiff rename to home/scripts/common/bin/nvimdiff diff --git a/scripts/common/bin/open-in-git-forge b/home/scripts/common/bin/open-in-git-forge similarity index 100% rename from scripts/common/bin/open-in-git-forge rename to home/scripts/common/bin/open-in-git-forge diff --git a/scripts/common/bin/optimize-photo-for-web b/home/scripts/common/bin/optimize-photo-for-web similarity index 100% rename from scripts/common/bin/optimize-photo-for-web rename to home/scripts/common/bin/optimize-photo-for-web diff --git a/scripts/common/bin/pass-migrate-to-pass-otp b/home/scripts/common/bin/pass-migrate-to-pass-otp similarity index 100% rename from scripts/common/bin/pass-migrate-to-pass-otp rename to home/scripts/common/bin/pass-migrate-to-pass-otp diff --git a/scripts/common/bin/pipeline b/home/scripts/common/bin/pipeline similarity index 100% rename from scripts/common/bin/pipeline rename to home/scripts/common/bin/pipeline diff --git a/scripts/common/bin/poll b/home/scripts/common/bin/poll similarity index 100% rename from scripts/common/bin/poll rename to home/scripts/common/bin/poll diff --git a/scripts/common/bin/pr-for-commit b/home/scripts/common/bin/pr-for-commit similarity index 100% rename from scripts/common/bin/pr-for-commit rename to home/scripts/common/bin/pr-for-commit diff --git a/scripts/common/bin/readme.md b/home/scripts/common/bin/readme.md similarity index 100% rename from scripts/common/bin/readme.md rename to home/scripts/common/bin/readme.md diff --git a/scripts/common/bin/remote b/home/scripts/common/bin/remote similarity index 100% rename from scripts/common/bin/remote rename to home/scripts/common/bin/remote diff --git a/scripts/common/bin/resource-usage b/home/scripts/common/bin/resource-usage similarity index 100% rename from scripts/common/bin/resource-usage rename to home/scripts/common/bin/resource-usage diff --git a/scripts/common/bin/s b/home/scripts/common/bin/s similarity index 100% rename from scripts/common/bin/s rename to home/scripts/common/bin/s diff --git a/scripts/common/bin/scn b/home/scripts/common/bin/scn similarity index 100% rename from scripts/common/bin/scn rename to home/scripts/common/bin/scn diff --git a/scripts/common/bin/screenshot b/home/scripts/common/bin/screenshot similarity index 100% rename from scripts/common/bin/screenshot rename to home/scripts/common/bin/screenshot diff --git a/scripts/common/bin/scrup b/home/scripts/common/bin/scrup similarity index 100% rename from scripts/common/bin/scrup rename to home/scripts/common/bin/scrup diff --git a/scripts/common/bin/scwd b/home/scripts/common/bin/scwd similarity index 100% rename from scripts/common/bin/scwd rename to home/scripts/common/bin/scwd diff --git a/scripts/common/bin/setbg b/home/scripts/common/bin/setbg similarity index 100% rename from scripts/common/bin/setbg rename to home/scripts/common/bin/setbg diff --git a/scripts/common/bin/source_if_exists b/home/scripts/common/bin/source_if_exists similarity index 100% rename from scripts/common/bin/source_if_exists rename to home/scripts/common/bin/source_if_exists diff --git a/scripts/common/bin/sw b/home/scripts/common/bin/sw similarity index 100% rename from scripts/common/bin/sw rename to home/scripts/common/bin/sw diff --git a/scripts/common/bin/tdf b/home/scripts/common/bin/tdf similarity index 100% rename from scripts/common/bin/tdf rename to home/scripts/common/bin/tdf diff --git a/scripts/common/bin/terminal-rendering-test b/home/scripts/common/bin/terminal-rendering-test similarity index 100% rename from scripts/common/bin/terminal-rendering-test rename to home/scripts/common/bin/terminal-rendering-test diff --git a/scripts/common/bin/termrec b/home/scripts/common/bin/termrec similarity index 100% rename from scripts/common/bin/termrec rename to home/scripts/common/bin/termrec diff --git a/scripts/common/bin/tls b/home/scripts/common/bin/tls similarity index 100% rename from scripts/common/bin/tls rename to home/scripts/common/bin/tls diff --git a/scripts/common/bin/tmux-edit-buffer b/home/scripts/common/bin/tmux-edit-buffer similarity index 100% rename from scripts/common/bin/tmux-edit-buffer rename to home/scripts/common/bin/tmux-edit-buffer diff --git a/scripts/common/bin/tmux-lyte-session b/home/scripts/common/bin/tmux-lyte-session similarity index 100% rename from scripts/common/bin/tmux-lyte-session rename to home/scripts/common/bin/tmux-lyte-session diff --git a/scripts/common/bin/tmux-save-buffer b/home/scripts/common/bin/tmux-save-buffer similarity index 100% rename from scripts/common/bin/tmux-save-buffer rename to home/scripts/common/bin/tmux-save-buffer diff --git a/scripts/common/bin/tmux-session-dir b/home/scripts/common/bin/tmux-session-dir similarity index 100% rename from scripts/common/bin/tmux-session-dir rename to home/scripts/common/bin/tmux-session-dir diff --git a/scripts/common/bin/tmux-session-preview b/home/scripts/common/bin/tmux-session-preview similarity index 100% rename from scripts/common/bin/tmux-session-preview rename to home/scripts/common/bin/tmux-session-preview diff --git a/scripts/common/bin/tmuxswitcher b/home/scripts/common/bin/tmuxswitcher similarity index 100% rename from scripts/common/bin/tmuxswitcher rename to home/scripts/common/bin/tmuxswitcher diff --git a/scripts/common/bin/unarchive b/home/scripts/common/bin/unarchive similarity index 100% rename from scripts/common/bin/unarchive rename to home/scripts/common/bin/unarchive diff --git a/scripts/common/bin/weather b/home/scripts/common/bin/weather similarity index 100% rename from scripts/common/bin/weather rename to home/scripts/common/bin/weather diff --git a/scripts/common/bin/work-journal-entry b/home/scripts/common/bin/work-journal-entry similarity index 100% rename from scripts/common/bin/work-journal-entry rename to home/scripts/common/bin/work-journal-entry diff --git a/scripts/common/bin/yamldiff b/home/scripts/common/bin/yamldiff similarity index 100% rename from scripts/common/bin/yamldiff rename to home/scripts/common/bin/yamldiff diff --git a/scripts/linux/bin/restartbar b/home/scripts/linux/bin/restartbar similarity index 100% rename from scripts/linux/bin/restartbar rename to home/scripts/linux/bin/restartbar diff --git a/scripts/linux/bin/startbar b/home/scripts/linux/bin/startbar similarity index 100% rename from scripts/linux/bin/startbar rename to home/scripts/linux/bin/startbar diff --git a/home/work.nix b/home/work.nix index 9180919..56bf1b3 100644 --- a/home/work.nix +++ b/home/work.nix @@ -1,8 +1,6 @@ -{ lib, ... }: -let +{lib, ...}: let username = "daniel.flanagan@divvypay.com"; -in -{ +in { home.username = username; home.homeDirectory = "/Users/${username}"; } diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..45aae31 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,6 @@ +# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/amd.nix b/modules/nixos/amd.nix similarity index 76% rename from modules/amd.nix rename to modules/nixos/amd.nix index b0308e2..8a9463d 100644 --- a/modules/amd.nix +++ b/modules/nixos/amd.nix @@ -1,3 +1,7 @@ -{ config, lib, ... }: { +{ + config, + lib, + ... +}: { hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..e10fa9d --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,14 @@ +# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + amd = import ./amd.nix; + default = import ./default.nix; + desktop-usage = import ./desktop-usage.nix; + intel = import ./intel.nix; + pipewire = import ./pipewire.nix; + podman = import ./podman.nix; + postgres = import ./postgres.nix; + sway = import ./sway.nix; + user-installed-applications = import ./user-installed-applications.nix; + wifi = import ./wifi.nix; +} diff --git a/modules/desktop-usage.nix b/modules/nixos/desktop-usage.nix similarity index 98% rename from modules/desktop-usage.nix rename to modules/nixos/desktop-usage.nix index bc08840..d135111 100644 --- a/modules/desktop-usage.nix +++ b/modules/nixos/desktop-usage.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { # TODO: add a DE and include either plasma or gnome as a fallback? imports = [ ./sway.nix @@ -6,7 +6,7 @@ ]; fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) + (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) (iosevka.override { set = "lyteterm"; privateBuildPlan = '' @@ -147,4 +147,3 @@ magicOrExtension = ''\x7fELF....AI\x02''; }; } - diff --git a/modules/intel.nix b/modules/nixos/intel.nix similarity index 79% rename from modules/intel.nix rename to modules/nixos/intel.nix index cc76b40..c945008 100644 --- a/modules/intel.nix +++ b/modules/nixos/intel.nix @@ -1,8 +1,12 @@ -{ lib, config, pkgs, ... }: { - +{ + lib, + config, + pkgs, + ... +}: { nixpkgs.config = { packageOverrides = pkgs: { - vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;}; }; }; diff --git a/modules/pipewire.nix b/modules/nixos/pipewire.nix similarity index 97% rename from modules/pipewire.nix rename to modules/nixos/pipewire.nix index 6bdacd0..3e4ed4f 100644 --- a/modules/pipewire.nix +++ b/modules/nixos/pipewire.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { services.pipewire = { enable = true; diff --git a/modules/podman.nix b/modules/nixos/podman.nix similarity index 96% rename from modules/podman.nix rename to modules/nixos/podman.nix index 7454962..7ce9734 100644 --- a/modules/podman.nix +++ b/modules/nixos/podman.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment = { systemPackages = with pkgs; [ podman-compose diff --git a/modules/postgres.nix b/modules/nixos/postgres.nix similarity index 95% rename from modules/postgres.nix rename to modules/nixos/postgres.nix index 84ee893..507160a 100644 --- a/modules/postgres.nix +++ b/modules/nixos/postgres.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: { +{pkgs, ...}: { # this is really just for development usage services.postgresql = { enable = true; - ensureDatabases = [ "daniel" ]; + ensureDatabases = ["daniel"]; ensureUsers = [ { name = "daniel"; diff --git a/modules/sway.nix b/modules/nixos/sway.nix similarity index 69% rename from modules/sway.nix rename to modules/nixos/sway.nix index ba753c3..6dcfe57 100644 --- a/modules/sway.nix +++ b/modules/nixos/sway.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -let +{pkgs, ...}: let # this is unused because it's referenced by my sway config dbus-sway-environment = pkgs.writeTextFile { name = "dbus-sway-environment"; @@ -7,10 +6,10 @@ let executable = true; text = '' - dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway - systemctl --user stop wireplumber xdg-desktop-portal xdg-desktop-portal-wlr - systemctl --user start wireplumber xdg-desktop-portal xdg-desktop-portal-wlr - ''; + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + systemctl --user stop wireplumber xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start wireplumber xdg-desktop-portal xdg-desktop-portal-wlr + ''; }; # this is unused because it's referenced by my sway config @@ -18,20 +17,17 @@ let name = "configure-gtk"; destination = "/bin/configure-gtk"; executable = true; - text = - let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - in - '' - export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS - gnome_schema = org.gnome.desktop.interface - gsettings set $gnome_schema gtk-theme 'Catppuccin-Mocha' - ''; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in '' + export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS + gnome_schema = org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme 'Catppuccin-Mocha' + ''; }; -in -{ - imports = [ ./pipewire.nix ]; +in { + imports = [./pipewire.nix]; # services.xserver.libinput.enable = true; @@ -61,7 +57,7 @@ in programs.thunar = { enable = true; - plugins = with pkgs.xfce; [ thunar-archive-plugin thunar-volman ]; + plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman]; }; services.gvfs = { diff --git a/modules/user-installed-applications.nix b/modules/nixos/user-installed-applications.nix similarity index 76% rename from modules/user-installed-applications.nix rename to modules/nixos/user-installed-applications.nix index 4b18e32..be23b6f 100644 --- a/modules/user-installed-applications.nix +++ b/modules/nixos/user-installed-applications.nix @@ -1,3 +1,3 @@ -{ ... }: { +{...}: { services.flatpak.enable = true; } diff --git a/modules/wifi.nix b/modules/nixos/wifi.nix similarity index 93% rename from modules/wifi.nix rename to modules/nixos/wifi.nix index 3d57dd3..3e47e83 100644 --- a/modules/wifi.nix +++ b/modules/nixos/wifi.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { networking.networkmanager.enable = true; # iwd? diff --git a/nixos/beefcake.nix b/nixos/beefcake.nix index e024a06..62005fa 100644 --- a/nixos/beefcake.nix +++ b/nixos/beefcake.nix @@ -1,40 +1,41 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running 'nixos-help'). - -{ modulesPath, config, pkgs, ... }: { +{ + modulesPath, + config, + pkgs, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ../modules/intel.nix ]; - boot.initrd.availableKernelModules = [ "ehci_pci" "megaraid_sas" "usbhid" "uas" "sd_mod" ]; - boot.kernelModules = [ "kvm-intel" ]; + boot.initrd.availableKernelModules = ["ehci_pci" "megaraid_sas" "usbhid" "uas" "sd_mod"]; + boot.kernelModules = ["kvm-intel"]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/0747dcba-f590-42e6-89c8-6cb2f9114d64"; - fsType = "ext4"; - options = [ - "usrquota" - ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/0747dcba-f590-42e6-89c8-6cb2f9114d64"; + fsType = "ext4"; + options = [ + "usrquota" + ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/7E3C-9018"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/7E3C-9018"; + fsType = "vfat"; + }; - fileSystems."/storage" = - { - device = "/dev/disk/by-uuid/ea8258d7-54d1-430e-93b3-e15d33231063"; - fsType = "btrfs"; - options = [ - "compress=zstd:5" - "space_cache=v2" - ]; - }; + fileSystems."/storage" = { + device = "/dev/disk/by-uuid/ea8258d7-54d1-430e-93b3-e15d33231063"; + fsType = "btrfs"; + options = [ + "compress=zstd:5" + "space_cache=v2" + ]; + }; services.nix-serve = { enable = true; @@ -55,7 +56,7 @@ sops = { defaultSopsFile = ../secrets/beefcake/secrets.yml; age = { - sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; keyFile = "/var/lib/sops-nix/key.txt"; generateKey = true; }; @@ -140,11 +141,11 @@ networking.hostName = "beefcake"; users.extraGroups = { - "plausible" = { }; - "lytedev" = { }; + "plausible" = {}; + "lytedev" = {}; }; - users.groups.daniel.members = [ "daniel" ]; - users.groups.nixadmin.members = [ "daniel" ]; + users.groups.daniel.members = ["daniel"]; + users.groups.nixadmin.members = ["daniel"]; users.users.daniel = { extraGroups = [ @@ -165,7 +166,7 @@ users.users.ben = { isNormalUser = true; - packages = [ pkgs.vim ]; + packages = [pkgs.vim]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUfLZ+IX85p9355Po2zP1H2tAxiE0rE6IYb8Sf+eF9T ben@benhany.com" ]; @@ -173,7 +174,7 @@ users.users.alan = { isNormalUser = true; - packages = [ pkgs.vim ]; + packages = [pkgs.vim]; openssh.authorizedKeys.keys = [ "" ]; @@ -182,9 +183,11 @@ users.users.restic = { # used for other machines to backup to isNormalUser = true; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJbPqzKB09U+i4Kqu136yOjflLZ/J7pYsNulTAd4x903 root@chromebox.h.lyte.dev" - ] ++ config.users.users.daniel.openssh.authorizedKeys.keys; + openssh.authorizedKeys.keys = + [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJbPqzKB09U+i4Kqu136yOjflLZ/J7pYsNulTAd4x903 root@chromebox.h.lyte.dev" + ] + ++ config.users.users.daniel.openssh.authorizedKeys.keys; }; users.users.guest = { @@ -201,13 +204,13 @@ group = "plausible"; }; - environment.systemPackages = [ pkgs.linuxquota ]; + environment.systemPackages = [pkgs.linuxquota]; # TODO: make the client declarative? right now I think it's manually git # clone'd to /root systemd.services.deno-netlify-ddns-client = { serviceConfig.Type = "oneshot"; - path = with pkgs; [ curl bash ]; + path = with pkgs; [curl bash]; environment = { NETLIFY_DDNS_RC_FILE = "/root/deno-netlify-ddns-client/.env"; }; @@ -216,8 +219,8 @@ ''; }; systemd.timers.deno-netlify-ddns-client = { - wantedBy = [ "timers.target" ]; - partOf = [ "deno-netlify-ddns-client.service" ]; + wantedBy = ["timers.target"]; + partOf = ["deno-netlify-ddns-client.service"]; timerConfig = { OnBootSec = "10sec"; OnUnitActiveSec = "5min"; @@ -277,7 +280,7 @@ nix.h.lyte.dev { reverse_proxy :${toString config.services.nix-serve.port} } - + # proxy everything else to chromebox :80 { reverse_proxy 10.0.0.5:80 @@ -369,7 +372,7 @@ services.postgresql = { enable = true; - ensureDatabases = [ "daniel" "plausible" ]; + ensureDatabases = ["daniel" "plausible"]; ensureUsers = [ { name = "daniel"; @@ -391,9 +394,9 @@ authentication = pkgs.lib.mkOverride 10 '' #type database DBuser auth-method - local all postgres peer map=superuser_map - local all daniel peer map=superuser_map - local sameuser all peer map=superuser_map + local all postgres peer map=superuser_map + local all daniel peer map=superuser_map + local sameuser all peer map=superuser_map local plausible plausible peer map=superuser_map # lan ipv4 @@ -452,8 +455,14 @@ services.openssh = { listenAddresses = [ - { addr = "0.0.0.0"; port = 64022; } - { addr = "0.0.0.0"; port = 22; } + { + addr = "0.0.0.0"; + port = 64022; + } + { + addr = "0.0.0.0"; + port = 22; + } ]; }; @@ -575,7 +584,7 @@ "/storage/postgres-backups" ]; - exclude = [ ]; + exclude = []; repository = "/storage/backups/local"; }; rascal = { diff --git a/nixos/common.nix b/nixos/common.nix index 55bfbbc..066a26b 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -1,8 +1,12 @@ -{ config, lib, inputs, system, ... }: -let - pkgs = inputs.nixpkgs.legacyPackages.${system}; -in { + config, + lib, + inputs, + system, + ... +}: let + pkgs = inputs.nixpkgs.legacyPackages.${system}; +in { services.journald.extraConfig = "SystemMaxUse=1G"; environment = { @@ -68,8 +72,8 @@ in "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev" ]; group = "daniel"; - extraGroups = [ "users" "wheel" "video" ]; - packages = [ ]; + extraGroups = ["users" "wheel" "video"]; + packages = []; }; root = { @@ -142,15 +146,15 @@ in firewall = { enable = lib.mkDefault true; allowPing = lib.mkDefault true; - allowedTCPPorts = lib.mkDefault [ 22 ]; - allowedUDPPorts = lib.mkDefault [ ]; + allowedTCPPorts = lib.mkDefault [22]; + allowedUDPPorts = lib.mkDefault []; }; }; nix = { settings = { - trusted-users = [ "root" "daniel" ]; - experimental-features = lib.mkDefault [ "nix-command" "flakes" ]; + trusted-users = ["root" "daniel"]; + experimental-features = lib.mkDefault ["nix-command" "flakes"]; substituters = [ "https://cache.nixos.org/" "https://helix.cachix.org" diff --git a/nixos.nix b/nixos/default.nix similarity index 55% rename from nixos.nix rename to nixos/default.nix index 64b4aab..6d75438 100644 --- a/nixos.nix +++ b/nixos/default.nix @@ -1,28 +1,29 @@ -inputs @ { self, ... }: -let +inputs @ {self, ...}: let daniel = system: { home-manager.users.daniel = { - imports = [ ./home/user.nix ./home/linux.nix ]; + imports = [./home/user.nix ./home/linux.nix]; }; }; hms = system: [ inputs.home-manager.nixosModules.home-manager (daniel system) ]; - disko = args @ { scheme, ... }: [ + disko = args @ {scheme, ...}: [ inputs.disko.nixosModules.disko self.diskoConfigurations.${scheme} - { _module.args = args; } + {_module.args = args;} ]; nixosSystem = system: modules: (inputs.nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs system; }; - modules = [ - inputs.sops-nix.nixosModules.sops - ./nixos/common.nix - ] ++ modules ++ hms system; + specialArgs = {inherit inputs system;}; + modules = + [ + inputs.sops-nix.nixosModules.sops + ./nixos/common.nix + ] + ++ modules + ++ hms system; }); -in -{ +in { # TODO: disko-fy rascal and beefcake? beefcake = nixosSystem "x86_64-linux" [ @@ -30,23 +31,26 @@ in inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev ]; - rascal = nixosSystem "x86_64-linux" [ ./nixos/rascal.nix ]; + rascal = nixosSystem "x86_64-linux" [./nixos/rascal.nix]; musicbox = nixosSystem "x86_64-linux" (disko { scheme = "unencrypted"; - disks = [ "/dev/sda" ]; - } ++ [ ./nixos/musicbox.nix ]); + disks = ["/dev/sda"]; + } + ++ [./nixos/musicbox.nix]); thinker = nixosSystem "x86_64-linux" (disko { scheme = "thinker"; - disks = [ "/dev/nvme0n1" ]; - } ++ [ ./nixos/thinker.nix ]); + disks = ["/dev/nvme0n1"]; + } + ++ [./nixos/thinker.nix]); dragon = nixosSystem "x86_64-linux" (disko { scheme = "standard"; - disks = [ "/dev/nvme0n1" ]; - } ++ [ ./nixos/dragon.nix ]); + disks = ["/dev/nvme0n1"]; + } + ++ [./nixos/dragon.nix]); } diff --git a/nixos/dragon.nix b/nixos/dragon.nix deleted file mode 100644 index 5e081d8..0000000 --- a/nixos/dragon.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ modulesPath, lib, pkgs, ... }: { - imports = - [ - ../modules/amd.nix - ../modules/desktop-usage.nix - ../modules/podman.nix - ../modules/wifi.nix - - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - # TODO: fonts? right now, I'm just installing to ~/.local/share/fonts - - # hardware - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.enable = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; - - networking.hostName = "dragon"; - - hardware.bluetooth.enable = true; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - services.printing.enable = true; - - environment = { - systemPackages = with pkgs; [ - radeontop - ]; - }; - - - networking = { - firewall = { - enable = true; - allowPing = true; - allowedTCPPorts = [ 22 ]; - allowedUDPPorts = [ ]; - }; - }; - - system.stateVersion = "23.11"; -} - diff --git a/nixos/dragon/default.nix b/nixos/dragon/default.nix new file mode 100644 index 0000000..db316d8 --- /dev/null +++ b/nixos/dragon/default.nix @@ -0,0 +1,53 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # outputs.nixosModules.example + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # Import your generated (nixos-generate-config) hardware configuration + ./hardware-configuration.nix + ]; + + # TODO: fonts? right now, I'm just installing to ~/.local/share/fonts + + # hardware + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.enable = true; + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; + + networking.hostName = "dragon"; + + hardware.bluetooth.enable = true; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + services.printing.enable = true; + + environment = { + systemPackages = with pkgs; [ + radeontop + ]; + }; + + networking = { + firewall = { + enable = true; + allowPing = true; + allowedTCPPorts = [22]; + allowedUDPPorts = []; + }; + }; + + system.stateVersion = "23.11"; +} diff --git a/nixos/musicbox.nix b/nixos/musicbox.nix index a773e64..0852386 100644 --- a/nixos/musicbox.nix +++ b/nixos/musicbox.nix @@ -1,10 +1,11 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running `nixos-help`). - -{ pkgs, inputs, ... }: - -let +{ + pkgs, + inputs, + ... +}: let # this is unused because it's referenced by my sway config dbus-sway-environment = pkgs.writeTextFile { name = "dbus-sway-environment"; @@ -23,31 +24,28 @@ let name = "configure-gtk"; destination = "/bin/configure-gtk"; executable = true; - text = - let - schema = pkgs.gsettings-desktop-schemas; - datadir = "${schema}/share/gsettings-schemas/${schema.name}"; - in - '' - export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS - gnome_schema = org.gnome.desktop.interface - gsettings set $gnome_schema gtk-theme 'Catppuccin-Mocha' - ''; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in '' + export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS + gnome_schema = org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme 'Catppuccin-Mocha' + ''; }; -in -{ +in { # TODO: fonts? right now, I'm just installing to ~/.local/share/fonts - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = ["nix-command" "flakes"]; - boot.loader.grub.devices = [ "/dev/sda" ]; + boot.loader.grub.devices = ["/dev/sda"]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; nixpkgs.config = { allowUnfree = true; packageOverrides = pkgs: { - vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;}; }; }; @@ -117,8 +115,8 @@ in openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev" ]; - extraGroups = [ "wheel" "video" "docker" ]; - packages = [ ]; + extraGroups = ["wheel" "video" "docker"]; + packages = []; }; services.dbus.enable = true; @@ -149,17 +147,19 @@ in PasswordAuthentication = false; }; listenAddresses = [ - { addr = "0.0.0.0"; port = 22; } + { + addr = "0.0.0.0"; + port = 22; + } ]; }; networking.firewall = { enable = true; allowPing = true; - allowedTCPPorts = [ ]; - allowedUDPPorts = [ ]; + allowedTCPPorts = []; + allowedUDPPorts = []; }; system.stateVersion = "23.05"; } - diff --git a/nixos/rascal.nix b/nixos/rascal.nix index b6202ad..842bf5f 100644 --- a/nixos/rascal.nix +++ b/nixos/rascal.nix @@ -1,11 +1,15 @@ -{ config, modulesPath, ... }: { +{ + config, + modulesPath, + ... +}: { imports = [ ../modules/amd.nix (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "usbhid" "uas" "sd_mod" ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "ehci_pci" "usbhid" "uas" "sd_mod"]; + boot.kernelModules = ["kvm-amd"]; fileSystems."/" = { device = "/dev/disk/by-uuid/2e2ad73a-6264-4a7b-8439-9c05295d903d"; @@ -25,11 +29,12 @@ users.users.beefcake = { # used for restic backups isNormalUser = true; - openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys ++ [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK7HrojwoyHED+A/FzRjYmIL0hzofwBd9IYHH6yV0oPO root@beefcake" - ]; + openssh.authorizedKeys.keys = + config.users.users.daniel.openssh.authorizedKeys.keys + ++ [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK7HrojwoyHED+A/FzRjYmIL0hzofwBd9IYHH6yV0oPO root@beefcake" + ]; }; system.stateVersion = "22.05"; } - diff --git a/nixos/thinker.nix b/nixos/thinker.nix index 9d8fad7..b12a5f2 100644 --- a/nixos/thinker.nix +++ b/nixos/thinker.nix @@ -1,13 +1,18 @@ -{ modulesPath, lib, ... }: { - imports = - [ - ../modules/intel.nix - ../modules/desktop-usage.nix - ../modules/podman.nix - ../modules/wifi.nix +{ + modulesPath, + lib, + ... +}: { + imports = [ + ../modules/intel.nix + ../modules/desktop-usage.nix + ../modules/podman.nix + ../modules/wifi.nix - (modulesPath + "/installer/scan/not-detected.nix") - ]; + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # TODO: https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/t480/default.nix # TODO: hibernation? I've been using [deep] in /sys/power/mem_sleep alright # with this machine so it may not be necessary? @@ -17,7 +22,7 @@ # hardware boot.loader.efi.canTouchEfiVariables = true; boot.loader.systemd-boot.enable = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; networking.hostName = "thinker"; @@ -30,11 +35,10 @@ firewall = { enable = true; allowPing = true; - allowedTCPPorts = [ 22 ]; - allowedUDPPorts = [ ]; + allowedTCPPorts = [22]; + allowedUDPPorts = []; }; }; system.stateVersion = "23.11"; } - diff --git a/old/third.nix b/old/third.nix deleted file mode 100644 index 24c1cc9..0000000 --- a/old/third.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, pkgs, ... }: { - imports = [ - ../profiles/laptop.nix - ../modules/systemd-boot-efi.nix - ../modules/intel.nix - ../modules/docker.nix - ../modules/network-manager.nix - ../modules/bluetooth.nix - ../modules/pulseaudio.nix - ../modules/de/sway.nix - ../modules/de/gnome.nix - ../modules/users/daniel.nix - ../modules/users/valerie.nix - ]; - - networking = { - hostName = "third.lyte.dev"; - firewall.enable = false; - networkmanager.wifi.powersave = true; - }; - - services.fwupd = { - enable = true; - }; - - console.useXkbConfig = true; - services.xserver.xkbOptions = "ctrl:nocaps"; - # TODO: setup caps-lock as Control/Escape? - # console.font = "TER16x32"; - - swapDevices = [{ device = "/swapfile"; size = (1024 * 16); }]; - - boot = { - # fallocate -l 16G /swapfile - resumeDevice = "/dev/disk/by-uuid/d1d92974-c0c0-4566-8131-c3dda9b21122"; - # sudo filefrag -v /swapfile | head -n 4 | tail -n 1 | \ - # tr -s "[:blank:]" | field 5 | tr -d ":" - kernelParams = [ "resume_offset=874496" ]; - }; - - # services.upower = { - # enable = true; - # criticalPowerAction = "Hibernate"; - # }; -} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..af56138 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,22 @@ +{inputs, ...}: { + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs {pkgs = final;}; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + # example = prev.example.overrideAttrs (oldAttrs: rec { + # ... + # }); + }; + + # When applied, the unstable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.unstable' + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..3d9e23c --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,5 @@ +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' +pkgs: { + # example = pkgs.callPackage ./example { }; +} diff --git a/pre-commit.bash b/pre-commit.bash index d4b4e43..159772f 100755 --- a/pre-commit.bash +++ b/pre-commit.bash @@ -3,4 +3,4 @@ set -eux nix flake check -nixpkgs-fmt --check . +nix run nixpkgs#alejandra -- --check . \ No newline at end of file