my system configurations ^-^

Compare changes

Choose any two refs to compare.

+22 -22
flake.lock
··· 131 131 }, 132 132 "darwin-stable": { 133 133 "locked": { 134 - "lastModified": 1764560356, 135 - "narHash": "sha256-M5aFEFPppI4UhdOxwdmceJ9bDJC4T6C6CzCK1E2FZyo=", 136 - "owner": "NixOS", 134 + "lastModified": 1766101392, 135 + "narHash": "sha256-UC9kmuWYesytXlGWXUEsCk6dotiQzQMb9xMWeDdobo0=", 136 + "owner": "nixos", 137 137 "repo": "nixpkgs", 138 - "rev": "6c8f0cca84510cc79e09ea99a299c9bc17d03cb6", 138 + "rev": "1a967e151e20260380c1457e584292a3712fd1fb", 139 139 "type": "github" 140 140 }, 141 141 "original": { 142 - "owner": "NixOS", 142 + "owner": "nixos", 143 143 "ref": "nixpkgs-25.05-darwin", 144 - "repo": "nixpkgs", 145 - "type": "github" 146 - } 147 - }, 148 - "darwin-unstable": { 149 - "locked": { 150 - "lastModified": 1764642553, 151 - "narHash": "sha256-mvbFFzVBhVK1FjyPHZGMAKpNiqkr7k++xIwy+p/NQvA=", 152 - "owner": "NixOS", 153 - "repo": "nixpkgs", 154 - "rev": "f720de59066162ee879adcc8c79e15c51fe6bfb4", 155 - "type": "github" 156 - }, 157 - "original": { 158 - "owner": "NixOS", 159 - "ref": "nixpkgs-unstable", 160 144 "repo": "nixpkgs", 161 145 "type": "github" 162 146 } ··· 518 502 "type": "github" 519 503 } 520 504 }, 505 + "nixpkgs-unstable": { 506 + "locked": { 507 + "lastModified": 1766125104, 508 + "narHash": "sha256-l/YGrEpLromL4viUo5GmFH3K5M1j0Mb9O+LiaeCPWEM=", 509 + "owner": "nixos", 510 + "repo": "nixpkgs", 511 + "rev": "7d853e518814cca2a657b72eeba67ae20ebf7059", 512 + "type": "github" 513 + }, 514 + "original": { 515 + "owner": "nixos", 516 + "ref": "nixpkgs-unstable", 517 + "repo": "nixpkgs", 518 + "type": "github" 519 + } 520 + }, 521 521 "nixpkgs_2": { 522 522 "locked": { 523 523 "lastModified": 1764642553, ··· 599 599 "agenix": "agenix", 600 600 "catppuccin": "catppuccin", 601 601 "darwin-stable": "darwin-stable", 602 - "darwin-unstable": "darwin-unstable", 603 602 "firefox-cascade": "firefox-cascade", 604 603 "flake-utils": "flake-utils", 605 604 "home-manager": "home-manager", ··· 610 609 "nixos-unstable": "nixos-unstable", 611 610 "nixos-wsl": "nixos-wsl", 612 611 "nixpkgs": "nixpkgs_2", 612 + "nixpkgs-unstable": "nixpkgs-unstable", 613 613 "quickshell": "quickshell", 614 614 "spicetify-nix": "spicetify-nix", 615 615 "stylix": "stylix",
+2 -3
flake.nix
··· 53 53 nixos-stable.url = "github:nixos/nixpkgs/nixos-25.05"; 54 54 nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 55 55 56 - darwin-stable.url = "github:NixOS/nixpkgs/nixpkgs-25.05-darwin"; 57 - darwin-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 56 + darwin-stable.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin"; 57 + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 58 58 59 59 nix-darwin = { 60 60 url = "github:nix-darwin/nix-darwin/nix-darwin-25.05"; 61 - # url = "github:nix-darwin/nix-darwin/master"; 62 61 inputs.nixpkgs.follows = "darwin-stable"; 63 62 }; 64 63
+1 -1
hosts/anemone/default.nix
··· 8 8 in { 9 9 imports = [ 10 10 ./hardware.nix 11 - ./klipper.nix 12 11 ./mainsail.nix 13 12 ./moonraker.nix 13 + ./klipper 14 14 inputs.nixos-hardware.nixosModules.raspberry-pi-3 15 15 (modulesPath + "/installer/scan/not-detected.nix") 16 16 (modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
+22
hosts/anemone/klipper/default.nix
··· 1 + {pkgs, ...}: let 2 + mainsail-config = pkgs.fetchFromGitHub { 3 + owner = "mainsail-crew"; 4 + repo = "mainsail-config"; 5 + rev = "ff3869a621db17ce3ef660adbbd3fa321995ac42"; 6 + hash = "sha256-gDMAUDqf8no66Jc/jutFNwu7RbD+/qD/6Q6GLWOAA/k="; 7 + }; 8 + in { 9 + services.klipper = { 10 + enable = true; 11 + # user = "klipper"; 12 + # group = "klipper"; 13 + # configDir = 14 + 15 + configFile = pkgs.writeText "klipper.cfg" '' 16 + [include ${mainsail-config}/client.cfg] 17 + [include ${./printer.cfg}] 18 + ''; 19 + 20 + # environment.etc 21 + }; 22 + }
+181
hosts/anemone/klipper/printer.cfg
··· 1 + # This file contains pin mappings for the stock 2020 Creality Ender 3 2 + # V2. To use this config, during "make menuconfig" select the 3 + # STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9) 4 + # communication. 5 + 6 + # If you prefer a direct serial connection, in "make menuconfig" 7 + # select "Enable extra low-level configuration options" and select 8 + # serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC 9 + # cable used for the LCD module as follows: 10 + # 3: Tx, 4: Rx, 9: GND, 10: VCC 11 + 12 + # Flash this firmware by copying "out/klipper.bin" to a SD card and 13 + # turning on the printer with the card inserted. The firmware 14 + # filename must end in ".bin" and must not match the last filename 15 + # that was flashed. 16 + 17 + # See docs/Config_Reference.md for a description of parameters. 18 + 19 + [stepper_x] 20 + step_pin: PC2 21 + dir_pin: PB9 22 + enable_pin: !PC3 23 + microsteps: 16 24 + rotation_distance: 40 25 + endstop_pin: ^PA5 26 + position_endstop: 0 27 + position_max: 247 28 + homing_speed: 50 29 + 30 + [stepper_y] 31 + step_pin: PB8 32 + dir_pin: PB7 33 + enable_pin: !PC3 34 + microsteps: 16 35 + rotation_distance: 40 36 + endstop_pin: ^PA6 37 + position_endstop: 0 38 + position_max: 235 39 + homing_speed: 50 40 + 41 + [stepper_z] 42 + step_pin: PB6 43 + dir_pin: !PB5 44 + enable_pin: !PC3 45 + microsteps: 16 46 + rotation_distance: 8 47 + endstop_pin: probe:z_virtual_endstop 48 + ; position_min: -3 # for calibrating bltouch z_offset 49 + position_max: 250 50 + homing_speed: 4 51 + second_homing_speed: 1 52 + homing_retract_dist: 2.0 53 + 54 + [extruder] 55 + max_extrude_only_distance: 350 56 + step_pin: PB4 57 + dir_pin: PB3 58 + enable_pin: !PC3 59 + microsteps: 16 60 + rotation_distance: 34.406 61 + nozzle_diameter: 0.400 62 + filament_diameter: 1.750 63 + heater_pin: PA1 64 + sensor_type: EPCOS 100K B57560G104F 65 + sensor_pin: PC5 66 + control: pid 67 + # tuned for stock hardware with 200 degree Celsius target 68 + pid_Kp: 21.527 69 + pid_Ki: 1.063 70 + pid_Kd: 108.982 71 + min_temp: 0 72 + max_temp: 250 73 + 74 + [heater_bed] 75 + heater_pin: PA2 76 + sensor_type: EPCOS 100K B57560G104F 77 + sensor_pin: PC4 78 + control: pid 79 + # tuned for stock hardware with 50 degree Celsius target 80 + pid_Kp: 54.027 81 + pid_Ki: 0.770 82 + pid_Kd: 948.182 83 + min_temp: 0 84 + max_temp: 130 85 + 86 + [fan] 87 + pin: PA0 88 + 89 + [mcu] 90 + serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 91 + restart_method: command 92 + 93 + [printer] 94 + kinematics: cartesian 95 + max_velocity: 180 96 + max_accel: 1500 97 + max_z_velocity: 5 98 + max_z_accel: 100 99 + 100 + # ABL specific settings 101 + 102 + [bltouch] 103 + sensor_pin: ^PB1 104 + control_pin: PB0 105 + x_offset: -46.8 # -45 on ender 3 v2 neo 106 + y_offset: -6 # -10 on ender 3 v2 neo 107 + z_offset: 1.434 # lower this number to move the nozzle higher 108 + speed: 20 109 + samples: 1 110 + sample_retract_dist: 8.0 111 + 112 + [safe_z_home] 113 + home_xy_position: 160,120 114 + speed: 150 115 + z_hop: 10 116 + z_hop_speed: 10 117 + 118 + [bed_mesh] 119 + speed: 120 120 + mesh_min: 30,30 121 + mesh_max: 189, 189 122 + probe_count: 5,5 123 + fade_start: 1 124 + fade_end: 10 125 + fade_target: 0 126 + algorithm: bicubic 127 + 128 + [bed_screws] 129 + screw1:30,25 130 + screw1_name:1 131 + screw2:200,25 132 + screw2_name:2 133 + screw3:200,195 134 + screw3_name:3 135 + screw4:30,195 136 + screw4_name:4 137 + 138 + [screws_tilt_adjust] 139 + screw1_name: front left screw 140 + screw1: 75, 32 141 + screw2_name: front right screw 142 + screw2: 246, 32 143 + screw3_name: rear right screw 144 + screw3: 246, 204 145 + screw4_name: rear left screw 146 + screw4: 75, 204 147 + horizontal_move_z: 10 148 + speed: 200 149 + screw_thread: CW-M4 # Use CW for Clockwise and CCW for Counter Clockwise 150 + 151 + [output_pin beeper] 152 + pin: PB13 153 + 154 + [virtual_sdcard] 155 + path: /var/lib/moonraker/gcodes 156 + 157 + [gcode_macro LOAD_FILAMENT] 158 + variable_load_distance: 350 159 + variable_purge_distance: 50 160 + gcode: 161 + {% set purge_speed = params.PURGE_SPEED|default(300) %} 162 + {% set load_speed = params.LOAD_SPEED|default(printer.configfile.settings['extruder'].max_extrude_only_velocity * 10) %} 163 + SAVE_GCODE_STATE NAME=load_state 164 + G91 165 + G92 E0 166 + G1 E{load_distance} F{load_speed} # fast-load 167 + G1 E{purge_distance} F{purge_speed} # purge 168 + RESTORE_GCODE_STATE NAME=load_state 169 + 170 + [gcode_macro UNLOAD_FILAMENT] 171 + variable_unload_distance: 350 172 + variable_purge_distance: 50 173 + gcode: 174 + {% set purge_speed = params.PURGE_SPEED|default(300) %} 175 + {% set unload_speed = params.LOAD_SPEED|default(printer.configfile.settings['extruder'].max_extrude_only_velocity * 10) %} 176 + SAVE_GCODE_STATE NAME=unload_state 177 + G91 178 + G92 E0 179 + G1 E{purge_distance} F{purge_speed} # purge 180 + G1 E-{unload_distance} F{unload_speed} # fast-unload 181 + RESTORE_GCODE_STATE NAME=unload_state
-8
hosts/anemone/klipper.nix
··· 1 - { 2 - services.klipper = { 3 - enable = true; 4 - # user = "klipper"; 5 - # group = "klipper"; 6 - configFile = ./printer.cfg; 7 - }; 8 - }
+3 -9
hosts/anemone/mainsail.nix
··· 1 - {pkgs, ...}: let 2 - mainsail-config = pkgs.fetchFromGitHub { 3 - owner = "mainsail-crew"; 4 - repo = "mainsail-config"; 5 - rev = "ff3869a621db17ce3ef660adbbd3fa321995ac42"; 6 - hash = "sha256-gDMAUDqf8no66Jc/jutFNwu7RbD+/qD/6Q6GLWOAA/k="; 7 - }; 8 - in { 1 + { 9 2 services.mainsail = { 10 3 enable = true; 4 + nginx.extraConfig = "client_max_body_size 1000M;"; 11 5 }; 6 + 12 7 networking.firewall.allowedTCPPorts = [80]; 13 - environment.etc."mainsail.cfg".source = "${mainsail-config}/client.cfg"; 14 8 }
+3 -3
hosts/anemone/moonraker.nix
··· 5 5 address = "0.0.0.0"; 6 6 port = 7125; 7 7 settings = { 8 - server = { 9 - max_upload_size = 32768; # in MB 10 - }; 8 + # server = { 9 + # max_upload_size = 32768; # in MB 10 + # }; 11 11 octoprint_compat = {}; 12 12 history = {}; 13 13 authorization = {
-183
hosts/anemone/printer.cfg
··· 1 - # This file contains pin mappings for the stock 2020 Creality Ender 3 2 - # V2. To use this config, during "make menuconfig" select the 3 - # STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9) 4 - # communication. 5 - 6 - # If you prefer a direct serial connection, in "make menuconfig" 7 - # select "Enable extra low-level configuration options" and select 8 - # serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC 9 - # cable used for the LCD module as follows: 10 - # 3: Tx, 4: Rx, 9: GND, 10: VCC 11 - 12 - # Flash this firmware by copying "out/klipper.bin" to a SD card and 13 - # turning on the printer with the card inserted. The firmware 14 - # filename must end in ".bin" and must not match the last filename 15 - # that was flashed. 16 - 17 - # See docs/Config_Reference.md for a description of parameters. 18 - 19 - [include mainsail.cfg] 20 - 21 - [stepper_x] 22 - step_pin: PC2 23 - dir_pin: PB9 24 - enable_pin: !PC3 25 - microsteps: 16 26 - rotation_distance: 40 27 - endstop_pin: ^PA5 28 - position_endstop: 0 29 - position_max: 247 30 - homing_speed: 50 31 - 32 - [stepper_y] 33 - step_pin: PB8 34 - dir_pin: PB7 35 - enable_pin: !PC3 36 - microsteps: 16 37 - rotation_distance: 40 38 - endstop_pin: ^PA6 39 - position_endstop: 0 40 - position_max: 235 41 - homing_speed: 50 42 - 43 - [stepper_z] 44 - step_pin: PB6 45 - dir_pin: !PB5 46 - enable_pin: !PC3 47 - microsteps: 16 48 - rotation_distance: 8 49 - endstop_pin: probe:z_virtual_endstop 50 - ; position_min: -3 # for calibrating bltouch z_offset 51 - position_max: 250 52 - homing_speed: 4 53 - second_homing_speed: 1 54 - homing_retract_dist: 2.0 55 - 56 - [extruder] 57 - max_extrude_only_distance: 350 58 - step_pin: PB4 59 - dir_pin: PB3 60 - enable_pin: !PC3 61 - microsteps: 16 62 - rotation_distance: 34.406 63 - nozzle_diameter: 0.400 64 - filament_diameter: 1.750 65 - heater_pin: PA1 66 - sensor_type: EPCOS 100K B57560G104F 67 - sensor_pin: PC5 68 - control: pid 69 - # tuned for stock hardware with 200 degree Celsius target 70 - pid_Kp: 21.527 71 - pid_Ki: 1.063 72 - pid_Kd: 108.982 73 - min_temp: 0 74 - max_temp: 250 75 - 76 - [heater_bed] 77 - heater_pin: PA2 78 - sensor_type: EPCOS 100K B57560G104F 79 - sensor_pin: PC4 80 - control: pid 81 - # tuned for stock hardware with 50 degree Celsius target 82 - pid_Kp: 54.027 83 - pid_Ki: 0.770 84 - pid_Kd: 948.182 85 - min_temp: 0 86 - max_temp: 130 87 - 88 - [fan] 89 - pin: PA0 90 - 91 - [mcu] 92 - serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 93 - restart_method: command 94 - 95 - [printer] 96 - kinematics: cartesian 97 - max_velocity: 180 98 - max_accel: 1500 99 - max_z_velocity: 5 100 - max_z_accel: 100 101 - 102 - # ABL specific settings 103 - 104 - [bltouch] 105 - sensor_pin: ^PB1 106 - control_pin: PB0 107 - x_offset: -46.8 # -45 on ender 3 v2 neo 108 - y_offset: -6 # -10 on ender 3 v2 neo 109 - z_offset: 1.434 # lower this number to move the nozzle higher 110 - speed: 20 111 - samples: 1 112 - sample_retract_dist: 8.0 113 - 114 - [safe_z_home] 115 - home_xy_position: 160,120 116 - speed: 150 117 - z_hop: 10 118 - z_hop_speed: 10 119 - 120 - [bed_mesh] 121 - speed: 120 122 - mesh_min: 30,30 123 - mesh_max: 189, 189 124 - probe_count: 5,5 125 - fade_start: 1 126 - fade_end: 10 127 - fade_target: 0 128 - algorithm: bicubic 129 - 130 - [bed_screws] 131 - screw1:30,25 132 - screw1_name:1 133 - screw2:200,25 134 - screw2_name:2 135 - screw3:200,195 136 - screw3_name:3 137 - screw4:30,195 138 - screw4_name:4 139 - 140 - [screws_tilt_adjust] 141 - screw1_name: front left screw 142 - screw1: 75, 32 143 - screw2_name: front right screw 144 - screw2: 246, 32 145 - screw3_name: rear right screw 146 - screw3: 246, 204 147 - screw4_name: rear left screw 148 - screw4: 75, 204 149 - horizontal_move_z: 10 150 - speed: 200 151 - screw_thread: CW-M4 # Use CW for Clockwise and CCW for Counter Clockwise 152 - 153 - [output_pin beeper] 154 - pin: PB13 155 - 156 - [virtual_sdcard] 157 - path: /var/lib/moonraker/gcodes 158 - 159 - [gcode_macro LOAD_FILAMENT] 160 - variable_load_distance: 350 161 - variable_purge_distance: 50 162 - gcode: 163 - {% set purge_speed = params.PURGE_SPEED|default(300) %} 164 - {% set load_speed = params.LOAD_SPEED|default(printer.configfile.settings['extruder'].max_extrude_only_velocity * 10) %} 165 - SAVE_GCODE_STATE NAME=load_state 166 - G91 167 - G92 E0 168 - G1 E{load_distance} F{load_speed} # fast-load 169 - G1 E{purge_distance} F{purge_speed} # purge 170 - RESTORE_GCODE_STATE NAME=load_state 171 - 172 - [gcode_macro UNLOAD_FILAMENT] 173 - variable_unload_distance: 350 174 - variable_purge_distance: 50 175 - gcode: 176 - {% set purge_speed = params.PURGE_SPEED|default(300) %} 177 - {% set unload_speed = params.LOAD_SPEED|default(printer.configfile.settings['extruder'].max_extrude_only_velocity * 10) %} 178 - SAVE_GCODE_STATE NAME=unload_state 179 - G91 180 - G92 E0 181 - G1 E{purge_distance} F{purge_speed} # purge 182 - G1 E-{unload_distance} F{unload_speed} # fast-unload 183 - RESTORE_GCODE_STATE NAME=unload_state
+16 -1
hosts/earthy/default.nix
··· 11 11 "${self}/modules/nixos" 12 12 ]; 13 13 14 - settings.system.hostName = "earthy"; 14 + settings = { 15 + system = { 16 + hostName = "earthy"; 17 + services = { 18 + sync.enable = true; 19 + navidrome.enable = true; 20 + }; 21 + }; 22 + }; 23 + 24 + services.openssh = { 25 + enable = true; 26 + settings = { 27 + PermitRootLogin = "yes"; 28 + }; 29 + }; 15 30 16 31 # samba 17 32 environment.systemPackages = [pkgs.cifs-utils];
+9
hosts/starling/default.nix
··· 25 25 group = "staff"; 26 26 home = "/Users/${cfg.system.user.name}"; 27 27 }; 28 + services.sync.enable = true; 29 + }; 30 + }; 31 + 32 + nix = { 33 + linux-builder = { 34 + enable = true; 35 + # systems = ["aarch64-linux"]; 36 + # config.boot.binfmt.emulatedSystems = ["x86_64-linux" "aarch64-linux"]; 28 37 }; 29 38 }; 30 39
-1
modules/darwin/homebrew.nix
··· 22 22 "mpd" 23 23 "ncmpcpp" 24 24 "spicetify-cli" 25 - "syncthing" 26 25 "yazi" 27 26 ]; 28 27
+1 -1
modules/darwin/nix/default.nix
··· 1 1 {self, ...}: let 2 2 inherit (self) outputs; 3 3 in { 4 - nixpkgs.overlays = [outputs.overlays.darwin-unstable]; 4 + nixpkgs.overlays = [outputs.overlays.nixpkgs-unstable]; 5 5 }
-1
modules/nixos/home/default.nix
··· 5 5 imports = [ 6 6 ./desktop 7 7 ./programs 8 - ./scripts 9 8 ./services 10 9 ./system 11 10 ./themes
-60
modules/nixos/home/programs/cli/beets.nix
··· 1 - { 2 - lib, 3 - osConfig, 4 - config, 5 - ... 6 - }: let 7 - cfg = osConfig.settings.programs; 8 - in { 9 - config = lib.mkIf (cfg.cli.enable 10 - && cfg.categories.music.enable) { 11 - systemd.user.services.mpdstats = { 12 - Unit = { 13 - Description = "Beets MPDStats daemon"; 14 - Requires = ["mpd.service"]; 15 - After = ["mpd.service"]; 16 - }; 17 - 18 - Install.WantedBy = ["default.target"]; 19 - 20 - Service = { 21 - ExecStart = "${config.programs.beets.package}/bin/beet mpdstats"; 22 - Restart = "on-failure"; 23 - }; 24 - }; 25 - programs.beets = { 26 - enable = true; 27 - mpdIntegration.enableUpdate = true; 28 - settings = { 29 - plugins = [ 30 - "fetchart" 31 - "thumbnails" 32 - "mbsync" 33 - "edit" 34 - ]; 35 - directory = "${config.xdg.userDirs.music}"; 36 - library = "${config.home.homeDirectory}/media/music_library.db"; 37 - import = { 38 - copy = true; 39 - write = true; 40 - autotag = true; 41 - }; 42 - paths = { 43 - default = "Albums/%upper{%left{$albumartist,1}}/$albumartist/$album%aunique{}/$track. $title"; 44 - singleton = "Singles/$artist/$title"; 45 - comp = "Compilations/$album%aunique{}/$track. $title"; 46 - }; 47 - fetchart = { 48 - auto = true; 49 - sources = [ 50 - "filesystem" 51 - "amazon" 52 - "itunes" 53 - "coverart" 54 - "albumart" 55 - ]; 56 - }; 57 - }; 58 - }; 59 - }; 60 - }
-1
modules/nixos/home/programs/cli/default.nix
··· 9 9 cfg = osConfig.settings.programs; 10 10 in { 11 11 imports = [ 12 - ./beets.nix 13 12 ./direnv.nix 14 13 ./hyfetch.nix 15 14 ./nushell.nix
-5
modules/nixos/home/scripts/default.nix
··· 1 - { 2 - imports = [ 3 - ./spotdl.nix 4 - ]; 5 - }
-34
modules/nixos/home/scripts/spotdl.nix
··· 1 - { 2 - pkgs, 3 - osConfig, 4 - lib, 5 - ... 6 - }: let 7 - cfg = osConfig.settings.programs.categories.music; 8 - 9 - # TODO)) Add queuing for multiple URLs 10 - bdl = pkgs.writeShellScriptBin "bdl" '' 11 - echo "Please enter the Spotify URL:" 12 - read -r url 13 - 14 - tmpdir=$(mktemp -d) || { echo "Failed to create temporary directory"; exit 1; } 15 - cd "$tmpdir" || { echo "Failed to change directory to $tmpdir"; exit 1; } 16 - 17 - ${pkgs.spotdl}/bin/spotdl "$url" 18 - 19 - if [ $? -eq 0 ]; then 20 - echo "Download complete. Now running 'beet im -m ~/tmpmusic'..." 21 - ${pkgs.beets}/bin/beet im -m "$tmpdir" 22 - else 23 - echo "Download failed. Please check the URL or your internet connection." 24 - exit 1 25 - fi 26 - 27 - rm -r "$tmpdir" 28 - echo "All operations completed successfully." 29 - ''; 30 - in { 31 - config = lib.mkIf cfg.enable { 32 - home.packages = [bdl]; 33 - }; 34 - }
-1
modules/nixos/programs/default.nix
··· 5 5 }: { 6 6 imports = [ 7 7 ./fonts.nix 8 - ./ssh.nix 9 8 ]; 10 9 11 10 programs = {
-15
modules/nixos/programs/ssh.nix
··· 1 - {self, ...}: { 2 - programs.ssh = { 3 - knownHosts = { 4 - "anemone" = { 5 - hostNames = ["10.10.1.245"]; 6 - publicKey = builtins.readFile "${self}/keys/anemone.pub"; 7 - }; 8 - }; 9 - extraConfig = '' 10 - Host anemone 11 - HostName 10.10.1.245 12 - Port 22 13 - ''; 14 - }; 15 - }
+1
modules/nixos/services/default.nix
··· 9 9 imports = [ 10 10 ./i18n.nix 11 11 ./mpdscribble.nix 12 + ./navidrome.nix 12 13 ./pipewire.nix 13 14 ./printing.nix 14 15 ./privacy.nix
+19
modules/nixos/services/navidrome.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: let 6 + cfg = config.settings.system.services.navidrome; 7 + in { 8 + config = lib.mkIf cfg.enable { 9 + services.navidrome = { 10 + enable = true; 11 + openFirewall = true; 12 + 13 + settings = { 14 + # TODO: use this value for beets 15 + MusicFolder = "${config.settings.system.user.home}/media/music/music"; 16 + }; 17 + }; 18 + }; 19 + }
+1
modules/shared/default.nix
··· 3 3 ./home 4 4 ./nix 5 5 ./options 6 + ./programs 6 7 ]; 7 8 }
+2
modules/shared/home/home.nix
··· 3 3 in { 4 4 imports = [ 5 5 ./programs 6 + ./scripts 7 + ./services 6 8 ./themes 7 9 ]; 8 10
+66
modules/shared/home/programs/cli/beets.nix
··· 1 + { 2 + lib, 3 + osConfig, 4 + config, 5 + pkgs, 6 + ... 7 + }: let 8 + cfg = osConfig.settings.programs; 9 + inherit (pkgs) stdenv; 10 + in { 11 + config = lib.mkIf (cfg.cli.enable 12 + && cfg.categories.music.enable) { 13 + systemd.user.services.mpdstats = 14 + lib.mkIf (stdenv.isLinux 15 + && config.services.mpd.enable) 16 + { 17 + Unit = { 18 + Description = "Beets MPDStats daemon"; 19 + Requires = ["mpd.service"]; 20 + After = ["mpd.service"]; 21 + }; 22 + 23 + Install.WantedBy = ["default.target"]; 24 + 25 + Service = { 26 + ExecStart = "${config.programs.beets.package}/bin/beet mpdstats"; 27 + Restart = "on-failure"; 28 + }; 29 + }; 30 + 31 + programs.beets = { 32 + enable = true; 33 + mpdIntegration.enableUpdate = true; 34 + settings = { 35 + plugins = [ 36 + "fetchart" 37 + "thumbnails" 38 + "mbsync" 39 + "edit" 40 + ]; 41 + directory = "${config.xdg.userDirs.music}/music"; 42 + library = "${config.xdg.userDirs.music}/music_library.db"; 43 + import = { 44 + copy = true; 45 + write = true; 46 + autotag = true; 47 + }; 48 + paths = { 49 + default = "Albums/%upper{%left{$albumartist,1}}/$albumartist/$album%aunique{}/$track. $title"; 50 + singleton = "Singles/$artist/$title"; 51 + comp = "Compilations/$album%aunique{}/$track. $title"; 52 + }; 53 + fetchart = { 54 + auto = true; 55 + sources = [ 56 + "filesystem" 57 + "amazon" 58 + "itunes" 59 + "coverart" 60 + "albumart" 61 + ]; 62 + }; 63 + }; 64 + }; 65 + }; 66 + }
+1
modules/shared/home/programs/cli/default.nix
··· 10 10 in { 11 11 imports = [ 12 12 ./bat.nix 13 + ./beets.nix 13 14 ./bun.nix 14 15 ./eza.nix 15 16 ./fzf.nix
+2
modules/shared/home/programs/tui/helix/default.nix
··· 32 32 command = lib.getExe pkgs.dprint; 33 33 args = [ 34 34 "fmt" 35 + "--stdin" 36 + "%{buffer_name}" 35 37 "--config" 36 38 "${config.xdg.configHome}/.dprint.jsonc" 37 39 ];
+5
modules/shared/home/scripts/default.nix
··· 1 + { 2 + imports = [ 3 + ./spotdl.nix 4 + ]; 5 + }
+36
modules/shared/home/scripts/spotdl.nix
··· 1 + { 2 + pkgs, 3 + osConfig, 4 + lib, 5 + ... 6 + }: let 7 + cfg = osConfig.settings.programs.categories.music; 8 + 9 + # TODO)) Add queuing for multiple URLs 10 + bdl = pkgs.writeShellScriptBin "bdl" '' 11 + echo "Please enter the Spotify URL:" 12 + ${lib.getExe pkgs.unstable.spotdl} --version 13 + 14 + read -r url 15 + 16 + tmpdir=$(mktemp -d) || { echo "Failed to create temporary directory"; exit 1; } 17 + cd "$tmpdir" || { echo "Failed to change directory to $tmpdir"; exit 1; } 18 + 19 + ${lib.getExe pkgs.unstable.spotdl} "$url" 20 + 21 + if [ $? -eq 0 ]; then 22 + echo "Download complete. Now running 'beet im -m ~/tmpmusic'..." 23 + ${lib.getExe pkgs.beets} im -m "$tmpdir" 24 + else 25 + echo "Download failed. Please check the URL or your internet connection." 26 + exit 1 27 + fi 28 + 29 + rm -r "$tmpdir" 30 + echo "All operations completed successfully." 31 + ''; 32 + in { 33 + config = lib.mkIf cfg.enable { 34 + home.packages = [bdl]; 35 + }; 36 + }
+3
modules/shared/home/services/default.nix
··· 1 + { 2 + imports = [./syncthing.nix]; 3 + }
+56
modules/shared/home/services/syncthing.nix
··· 1 + { 2 + config, 3 + lib, 4 + osConfig, 5 + ... 6 + }: let 7 + cfg = osConfig.settings.system.services.sync; 8 + 9 + devices = { 10 + starling.id = "3NK35IK-ZONOPLB-R277NP3-MUTEU33-PFKOWCZ-U3SB6ZO-YPIBVY5-UTCTIQK"; 11 + earthy.id = "CARNCAO-VNEVXKV-R3NIN2R-APRWTXC-4QCKEVX-ZQI7LZG-GZHAUFU-4XCJYQQ"; 12 + }; 13 + allDevices = builtins.attrNames devices; 14 + in { 15 + # https://github.com/nix-community/home-manager/issues/6542 16 + # syncthing config not applied on switch on darwin 17 + # 18 + # touch ~/Library/Application\ Support/Syncthing/.launchd_update_config 19 + 20 + config = lib.mkIf cfg.enable { 21 + services.syncthing = { 22 + enable = true; 23 + 24 + settings = { 25 + inherit devices; 26 + options = { 27 + urAccepted = -1; # disable usage reporting 28 + # relaysEnabled = false; 29 + }; 30 + folders = { 31 + docs = { 32 + label = "Documents"; 33 + devices = allDevices; 34 + path = config.xdg.userDirs.documents; 35 + }; 36 + music = { 37 + label = "Music"; 38 + devices = allDevices; 39 + path = config.xdg.userDirs.music; 40 + }; 41 + pictures = { 42 + label = "Pictures"; 43 + devices = allDevices; 44 + path = config.xdg.userDirs.pictures; 45 + }; 46 + videos = { 47 + label = "Videos"; 48 + devices = allDevices; 49 + path = config.xdg.userDirs.videos; 50 + }; 51 + }; 52 + }; 53 + extraOptions = ["--no-default-folder"]; # don't create default ~/Sync folder 54 + }; 55 + }; 56 + }
+46 -100
modules/shared/options/default.nix
··· 11 11 programs = { 12 12 enable = 13 13 mkEnableOption "Enable all programs" 14 - // { 15 - default = true; 16 - }; 14 + // {default = true;}; 17 15 18 - cli = { 19 - enable = 20 - mkEnableOption "Enable CLI programs" 21 - // { 22 - default = cfg.programs.enable; 23 - }; 24 - }; 25 - gui = { 26 - enable = 27 - mkEnableOption "Enable GUI programs" 28 - // { 29 - default = cfg.desktop.enable; 30 - }; 31 - }; 32 - tui = { 33 - enable = 34 - mkEnableOption "Enable TUI programs" 35 - // { 36 - default = cfg.programs.enable; 37 - }; 38 - }; 16 + cli.enable = 17 + mkEnableOption "Enable CLI programs" 18 + // {default = cfg.programs.enable;}; 19 + tui.enable = 20 + mkEnableOption "Enable TUI programs" 21 + // {default = cfg.programs.enable;}; 22 + gui.enable = 23 + mkEnableOption "Enable GUI programs" 24 + // {default = cfg.desktop.enable;}; 39 25 40 26 categories = { 41 27 enable = 42 28 mkEnableOption "Enable all program categories" 43 - // { 44 - default = cfg.programs.enable; 45 - }; 29 + // {default = cfg.programs.enable;}; 46 30 core.enable = 47 31 mkEnableOption "Enable core programs" 48 - // { 49 - default = cfg.programs.categories.enable; 50 - }; 32 + // {default = cfg.programs.categories.enable;}; 51 33 design.enable = 52 34 mkEnableOption "Enable design programs" 53 - // { 54 - default = cfg.programs.categories.enable; 55 - }; 35 + // {default = cfg.programs.categories.enable;}; 56 36 dev.enable = 57 37 mkEnableOption "Enable development programs" 58 - // { 59 - default = cfg.programs.categories.enable; 60 - }; 38 + // {default = cfg.programs.categories.enable;}; 61 39 edu.enable = 62 40 mkEnableOption "Enable educational programs" 63 - // { 64 - default = cfg.programs.categories.enable; 65 - }; 41 + // {default = cfg.programs.categories.enable;}; 66 42 fs.enable = 67 43 mkEnableOption "Enable file management programs" 68 - // { 69 - default = cfg.programs.categories.enable; 70 - }; 44 + // {default = cfg.programs.categories.enable;}; 71 45 fun.enable = 72 46 mkEnableOption "Enable fun programs" 73 - // { 74 - default = cfg.programs.categories.enable; 75 - }; 47 + // {default = cfg.programs.categories.enable;}; 76 48 gaming.enable = 77 49 mkEnableOption "Enable gaming programs" 78 - // { 79 - default = cfg.programs.categories.enable; 80 - }; 50 + // {default = cfg.programs.categories.enable;}; 81 51 mail.enable = 82 52 mkEnableOption "Enable email programs" 83 - // { 84 - default = cfg.programs.categories.enable; 85 - }; 53 + // {default = cfg.programs.categories.enable;}; 86 54 media.enable = 87 55 mkEnableOption "Enable multimedia programs" 88 - // { 89 - default = cfg.programs.categories.enable; 90 - }; 56 + // {default = cfg.programs.categories.enable;}; 91 57 music.enable = 92 58 mkEnableOption "Enable music programs" 93 - // { 94 - default = cfg.programs.categories.enable; 95 - }; 59 + // {default = cfg.programs.categories.enable;}; 96 60 printing.enable = 97 61 mkEnableOption "Enable 3D printing programs" 98 - // { 99 - default = cfg.programs.categories.enable; 100 - }; 62 + // {default = cfg.programs.categories.enable;}; 101 63 privacy.enable = 102 64 mkEnableOption "Enable privacy programs" 103 - // { 104 - default = cfg.programs.categories.enable; 105 - }; 65 + // {default = cfg.programs.categories.enable;}; 106 66 tools.enable = 107 67 mkEnableOption "Enable QOL programs" 108 - // { 109 - default = cfg.programs.categories.enable; 110 - }; 68 + // {default = cfg.programs.categories.enable;}; 111 69 web.enable = 112 70 mkEnableOption "Enable browsers" 113 - // { 114 - default = cfg.programs.categories.enable; 115 - }; 71 + // {default = cfg.programs.categories.enable;}; 116 72 }; 117 73 }; 74 + 118 75 system = { 119 76 user = { 120 77 name = mkOption { ··· 133 90 default = "users"; 134 91 }; 135 92 }; 93 + 136 94 hostName = mkOption { 137 95 type = types.str; 138 96 description = "The hostname of your system"; 139 97 default = "nixos"; 140 98 }; 99 + 141 100 services = { 142 101 enable = 143 102 mkEnableOption "Enable system services" 144 - // { 145 - default = true; 146 - }; 103 + // {default = true;}; 147 104 bluetooth.enable = 148 105 mkEnableOption "Enable Bluetooth" 149 - // { 150 - default = cfg.system.services.enable; 151 - }; 106 + // {default = cfg.system.services.enable;}; 152 107 sound.enable = 153 108 mkEnableOption "Enable sound" 154 - // { 155 - default = cfg.system.services.enable; 156 - }; 109 + // {default = cfg.system.services.enable;}; 110 + sync.enable = 111 + mkEnableOption "Enable syncthing" 112 + // {default = false;}; 157 113 printing.enable = 158 114 mkEnableOption "Enable printing" 159 - // { 160 - default = cfg.system.services.enable; 161 - }; 115 + // {default = cfg.system.services.enable;}; 116 + navidrome.enable = 117 + mkEnableOption "Enable navidrome" 118 + // {default = false;}; 162 119 networking.enable = 163 120 mkEnableOption "Enable networking" 164 - // { 165 - default = cfg.system.services.enable; 166 - }; 121 + // {default = cfg.system.services.enable;}; 167 122 security.enable = 168 123 mkEnableOption "Enable security" 169 - // { 170 - default = cfg.system.services.enable; 171 - }; 124 + // {default = cfg.system.services.enable;}; 172 125 backups.enable = 173 - mkEnableOption "Enable backups" 174 - // { 175 - default = cfg.system.services.enable; 176 - }; 126 + mkEnableOption "Enable restic" 127 + // {default = false;}; 177 128 }; 178 129 }; 130 + 179 131 desktop = { 180 132 enable = 181 133 mkEnableOption "Enable desktop environment" 182 - // { 183 - default = true; 184 - }; 134 + // {default = true;}; 185 135 niri.enable = 186 136 mkEnableOption "Enable Niri twm" 187 - // { 188 - default = cfg.desktop.enable; 189 - }; 137 + // {default = cfg.desktop.enable;}; 190 138 hyprland.enable = 191 139 mkEnableOption "Enable Hyprland and its ecosystem" 192 - // { 193 - default = cfg.desktop.enable; 194 - }; 140 + // {default = cfg.desktop.enable;}; 195 141 }; 196 142 }; 197 143 }
+3
modules/shared/programs/default.nix
··· 1 + { 2 + imports = [./ssh.nix]; 3 + }
+15
modules/shared/programs/ssh.nix
··· 1 + {self, ...}: { 2 + programs.ssh = { 3 + knownHosts = { 4 + "anemone" = { 5 + hostNames = ["10.10.1.245"]; 6 + publicKey = builtins.readFile "${self}/keys/anemone.pub"; 7 + }; 8 + }; 9 + extraConfig = '' 10 + Host anemone 11 + HostName 10.10.1.245 12 + Port 22 13 + ''; 14 + }; 15 + }
+2 -2
overlays.nix
··· 3 3 inputs, 4 4 ... 5 5 }: { 6 - darwin-unstable = final: _prev: { 7 - unstable = import inputs.darwin-unstable { 6 + nixpkgs-unstable = final: _prev: { 7 + unstable = import inputs.nixpkgs-unstable { 8 8 system = final.system; 9 9 config.allowUnfree = true; 10 10 };