diff --git a/common/allow-unfree.nix b/common/allow-unfree.nix new file mode 100644 index 0000000..c118726 --- /dev/null +++ b/common/allow-unfree.nix @@ -0,0 +1,8 @@ +{ pkgs,... }: { + # Allows non-free packages to be installed + nixpkgs = { + config = { + allowUnfree = true; + }; + }; +} \ No newline at end of file diff --git a/common/boot-logo.png b/common/boot-logo.png deleted file mode 100644 index ce0c98c..0000000 Binary files a/common/boot-logo.png and /dev/null differ diff --git a/common/de/hyprland.nix b/common/de/hyprland.nix index b8ff0f7..1feb892 100644 --- a/common/de/hyprland.nix +++ b/common/de/hyprland.nix @@ -1,4 +1,4 @@ { - # Not working on my hardware for some reason + # Not working on phoenix for some reason programs.hyprland.enable = true; } diff --git a/common/de/plasma-packages.nix b/common/de/plasma-packages.nix new file mode 100644 index 0000000..3faf6d9 --- /dev/null +++ b/common/de/plasma-packages.nix @@ -0,0 +1,16 @@ +{ pkgs, ...}: { + environment.systemPackages = with pkgs; [ + # See ./plasma6.nix + ksshaskpass + + libreoffice + kleopatra + kate + partition-manager + gparted + librewolf + vscodium + vlc + filelight + ]; +} \ No newline at end of file diff --git a/common/de/plasma5.nix b/common/de/plasma5.nix index 3606312..a800835 100644 --- a/common/de/plasma5.nix +++ b/common/de/plasma5.nix @@ -1,8 +1,22 @@ -{ +{ pkgs, ...}: { + imports = [ + ./plasma-packages.nix + ]; + + # Enable Xorg/Plasma5 services.xserver = { enable = true; displayManager.sddm.enable = true; desktopManager.plasma5.enable = true; }; + + # Use ksshaskpass to access stored secrets + environment.sessionVariables = rec { + GIT_ASKPASS=ksshaskpass + }; + + programs.kdeconnect = { + enable = true; + }; } diff --git a/common/de/plasma6.nix b/common/de/plasma6.nix index c888196..7347178 100644 --- a/common/de/plasma6.nix +++ b/common/de/plasma6.nix @@ -1,11 +1,9 @@ -{ - services.desktopManager.plasma6.enable = true; - - services.xserver = { - enable = false; - libinput.enable = true; - }; +{ pkgs, ...}: { + imports = [ + ./plasma-packages.nix + ]; + # Enable Wayland/Plasma6 services.displayManager = { sddm = { enable = true; @@ -14,4 +12,15 @@ defaultSession = "plasma"; }; + + services.desktopManager.plasma6.enable = true; + + # Use ksshaskpass to access stored secrets + environment.sessionVariables = rec { + GIT_ASKPASS = "ksshaskpass"; + }; + + programs.kdeconnect = { + enable = true; + }; } diff --git a/common/default-minimal.nix b/common/default-minimal.nix deleted file mode 100644 index d76aa1f..0000000 --- a/common/default-minimal.nix +++ /dev/null @@ -1,107 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - imports = [ - # ./packages/neovim.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) - ]; - # Configure your nixpkgs instance - config = { - # Disable if you don't want unfree packages - allowUnfree = true; - }; - }; - - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake - nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! - nix.nixPath = ["/etc/nix/path"]; - environment.etc = - lib.mapAttrs' - (name: value: { - name = "nix/path/${name}"; - value.source = value.flake; - }) - config.nix.registry; - - nix.settings = { - # Enable flakes and new 'nix' command - experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store - auto-optimise-store = true; - }; - - # boot.loader = { - # systemd-boot = { - # enable = true; - - # editor = true; # todo - # # memtest86.enable = true; - # }; - - # efi.canTouchEfiVariables = true; - - # grub = { - # #theme = pkgs.sleek-grub-theme; - # #splashImage = ./boot-logo.png; - # }; - # }; - - # Set your time zone. - time.timeZone = "Europe/Paris"; - - services.fwupd.enable = true; - - networking = { - networkmanager.enable = true; - - firewall.enable = true; - }; - - nix.settings.allowed-users = ["@wheel"]; - - security.sudo.execWheelOnly = true; - - services.tailscale.enable = true; - - environment.systemPackages = with pkgs; [ - wget - dig - nmap - btop - gitFull - smartmontools - lm_sensors - pciutils - gcc - gnumake - sysstat - file - ]; -} diff --git a/common/default.nix b/common/default.nix index a6d16b0..830c09c 100644 --- a/common/default.nix +++ b/common/default.nix @@ -28,11 +28,6 @@ # }); # }) ]; - # Configure your nixpkgs instance - config = { - # Disable if you don't want unfree packages - allowUnfree = true; - }; }; # This will add each flake input as a registry @@ -58,59 +53,14 @@ }; boot.loader = { - systemd-boot = { - enable = true; - - editor = true; # todo - # memtest86.enable = true; - }; + systemd-boot.enable = true; efi.canTouchEfiVariables = true; - - grub = { - #theme = pkgs.sleek-grub-theme; - #splashImage = ./boot-logo.png; - }; }; # Set your time zone. time.timeZone = "Europe/Paris"; - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - users.defaultUserShell = pkgs.zsh; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestions.enable = true; - syntaxHighlighting.enable = true; - - shellAliases = { - ll = "ls -al"; - }; - - ohMyZsh = { - enable = true; - plugins = [ - "git" - ]; - theme = "robbyrussell"; - }; - }; - services.fwupd.enable = true; networking = { @@ -120,7 +70,6 @@ }; nix.settings.allowed-users = ["@wheel"]; - security.sudo.execWheelOnly = true; services.tailscale.enable = true; @@ -143,6 +92,7 @@ dig nmap btop + gitFull smartmontools lm_sensors pciutils @@ -151,15 +101,5 @@ sysstat file ffmpeg - syncthing - - kate - partition-manager - gparted - librewolf - vscodium - vlc - filelight - libreoffice ]; } diff --git a/common/full-install.nix b/common/full-install.nix new file mode 100644 index 0000000..2cbf1a8 --- /dev/null +++ b/common/full-install.nix @@ -0,0 +1,43 @@ +{ + pkgs, + ... +}: { + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Z Shell + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + syntaxHighlighting.enable = true; + + shellAliases = { + ll = "ls -al"; + }; + + ohMyZsh = { + enable = true; + plugins = [ + "git" + ]; + theme = "robbyrussell"; + }; + }; + users.defaultUserShell = pkgs.zsh; + + environment.systemPackages = with pkgs; [ + # + ]; +} \ No newline at end of file diff --git a/common/hardware/raspberry-pi.nix b/common/hardware/raspberry-pi.nix new file mode 100644 index 0000000..28d6d53 --- /dev/null +++ b/common/hardware/raspberry-pi.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + # Disable systemd-boot + boot.loader = { + systemd-boot = { + enable = false; + }; + + efi.canTouchEfiVariables = false; + }; + + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; + + # firmware + hardware.enableRedistributableFirmware = true; +} \ No newline at end of file diff --git a/common/locales/en-keymap.nix b/common/locales/en-keymap.nix index 49c3cf9..eed8b23 100644 --- a/common/locales/en-keymap.nix +++ b/common/locales/en-keymap.nix @@ -1,6 +1,4 @@ { - # console.keyMap = "en"; - services.xserver.xkb = { layout = "us"; }; diff --git a/common/locales/en.nix b/common/locales/en.nix index 5e44a81..f54f58d 100644 --- a/common/locales/en.nix +++ b/common/locales/en.nix @@ -1,5 +1,6 @@ { time.timeZone = "Europe/Paris"; + i18n = { defaultLocale = "en_US.UTF-8"; extraLocaleSettings = { diff --git a/common/locales/fr.nix b/common/locales/fr.nix index bd112b0..52c7e03 100644 --- a/common/locales/fr.nix +++ b/common/locales/fr.nix @@ -1,5 +1,6 @@ { time.timeZone = "Europe/Paris"; + i18n = { defaultLocale = "fr_FR.UTF-8"; extraLocaleSettings = { diff --git a/common/packages/adguardhome.nix b/common/packages/adguardhome.nix index d7c8d4b..25ad939 100644 --- a/common/packages/adguardhome.nix +++ b/common/packages/adguardhome.nix @@ -1,4 +1,5 @@ { + # Ad-blocking DNS server services.adguardhome.enable = true; networking.nameservers = ["127.0.0.1"]; diff --git a/common/packages/syncthing.nix b/common/packages/syncthing.nix index a5221bb..5342a21 100644 --- a/common/packages/syncthing.nix +++ b/common/packages/syncthing.nix @@ -1,4 +1,5 @@ { + # File sync service services.syncthing = { enable = true; user = "user"; diff --git a/flake.lock b/flake.lock index b60531e..6956fd9 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1713248628, + "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", "type": "github" }, "original": { @@ -25,11 +25,11 @@ }, "stable": { "locked": { - "lastModified": 1712867921, - "narHash": "sha256-edTFV4KldkCMdViC/rmpJa7oLIU8SE/S35lh/ukC7bg=", + "lastModified": 1713145326, + "narHash": "sha256-m7+IWM6mkWOg22EC5kRUFCycXsXLSU7hWmHdmBfmC3s=", "owner": "nixos", "repo": "nixpkgs", - "rev": "51651a540816273b67bc4dedea2d37d116c5f7fe", + "rev": "53a2c32bc66f5ae41a28d7a9a49d321172af621e", "type": "github" }, "original": { @@ -41,11 +41,11 @@ }, "unstable": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1713248628, + "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5c75c8c..6fbf928 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,14 @@ ]; }; + new-phoenix = stable.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = {inherit inputs outputs;}; + modules = [ + ./hosts/new-phoenix/configuration.nix + ]; + }; + pc = unstable.lib.nixosSystem { system = "x86_64-linux"; specialArgs = {inherit inputs outputs;}; diff --git a/hosts/enry/configuration.nix b/hosts/enry/configuration.nix index cdf033d..df0f2ff 100644 --- a/hosts/enry/configuration.nix +++ b/hosts/enry/configuration.nix @@ -5,22 +5,12 @@ }: { imports = [ ./hardware-configuration.nix - ../../common/default-minimal.nix + ../../common/default.nix + ../../common/hardware/raspberry-pi.nix - # ../../common/packages/syncthing.nix - - # 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 + ../../modules/nixos/vedirect-reader.nix ]; - boot.loader.grub.enable = false; - # Enables the generation of /boot/extlinux/extlinux.conf - boot.loader.generic-extlinux-compatible.enable = true; - networking = { hostName = "enry"; @@ -29,48 +19,30 @@ # firewall.allowedUDPPorts = [8080]; }; + # services.vedirect-reader.enable = true; + users.users.user = { isNormalUser = true; description = "User"; - extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"]; + extraGroups = ["networkmanager" "wheel" "dialout"]; initialPassword = "correcthorsebatterystaple"; openssh.authorizedKeys.keys = [ "SHA256:RrcbPCE9BPVLAEhERm81NwXA28OKpn9U6irR2vG7K5I user@phoenix" ]; }; - # services.btrfs.autoScrub = { - # enable = true; - # interval = "weekly"; - # fileSystems = ["/" "/data"]; - # }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # This setups a SSH server. Very important if you're setting up a headless system. - # Feel free to remove if you don't need it. services.openssh = { enable = true; settings = { - # Forbid root login through SSH. - PermitRootLogin = "yes"; - # Use keys only. Remove if you want to SSH using password (not recommended) - PasswordAuthentication = true; + PermitRootLogin = "no"; + PasswordAuthentication = false; }; }; environment.systemPackages = with pkgs; [ + # ]; - hardware.enableRedistributableFirmware = true; - # networking.wireless.enable = true; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "23.11"; } diff --git a/hosts/new-phoenix/configuration.nix b/hosts/new-phoenix/configuration.nix new file mode 100644 index 0000000..d7b3fed --- /dev/null +++ b/hosts/new-phoenix/configuration.nix @@ -0,0 +1,69 @@ +{ + pkgs, + lib, + ... +}: { + imports = [ + ./hardware-configuration.nix + ../../common/default.nix + # ../../common/full-install.nix + + ../../common/locales/en.nix + ../../common/locales/fr-keymap.nix + ../../common/hardware/intelcpu.nix + # ../../common/hardware/amdgpu.nix + + ../../common/packages/syncthing.nix + ../../common/packages/adguardhome.nix + ]; + + networking = { + hostName = "phoenix"; + + firewall.enable = true; + firewall.allowedTCPPorts = [ + 12345 # tildefriends + 13378 # audiobookshelf + ]; + firewall.allowedUDPPorts = [ + 12345 # tildefriends + ]; + }; + + users.users.user = { + isNormalUser = true; + description = "User"; + extraGroups = ["networkmanager" "wheel" "syncthing"]; + initialPassword = "correcthorsebatterystaple"; + openssh.authorizedKeys.keys = [ + # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect + ]; + }; + + services.btrfs.autoScrub = { + enable = true; + interval = "weekly"; + fileSystems = ["/" "/data"]; + }; + + virtualisation.docker.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + services.syncthing = { + dataDir = lib.mkForce "/home/user"; + configDir = lib.mkForce "/data/sync/configuration/"; + }; + + # Needed to build enry + boot.binfmt.emulatedSystems = ["aarch64-linux"]; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; +} diff --git a/hosts/new-phoenix/hardware-configuration.nix b/hosts/new-phoenix/hardware-configuration.nix new file mode 100644 index 0000000..b6dc63b --- /dev/null +++ b/hosts/new-phoenix/hardware-configuration.nix @@ -0,0 +1,55 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/469da268-3ac1-4591-9209-26c89afb2e59"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + boot.initrd.luks.devices."luks-06613ddd-abd6-409e-9a33-889cb9d15d11".device = "/dev/disk/by-uuid/06613ddd-abd6-409e-9a33-889cb9d15d11"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/E398-A9BF"; + fsType = "vfat"; + }; + + fileSystems."/data" = { + device = "/dev/disk/by-uuid/648ae2f4-bd2e-4315-b12f-72733f92d2e0"; + fsType = "btrfs"; + }; + + boot.initrd.luks.devices."539c1a57-e6d0-4ff0-927a-8f0d4aa4c9c7".device = "/dev/disk/by-uuid/539c1a57-e6d0-4ff0-927a-8f0d4aa4c9c7"; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/469da268-3ac1-4591-9209-26c89afb2e59"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + swapDevices = []; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index 73182a9..8208659 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -6,6 +6,8 @@ imports = [ ./hardware-configuration.nix ../../common/default.nix + ../../common/full-install.nix + ../../common/allow-unfree.nix ../../common/locales/en.nix ../../common/locales/en-keymap.nix @@ -35,14 +37,12 @@ hostName = "pc"; firewall.enable = true; - firewall.allowedTCPPorts = [8080 12345 13378]; - firewall.allowedUDPPorts = [8080]; }; users.users.user = { isNormalUser = true; description = "User"; - extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"]; + extraGroups = ["networkmanager" "wheel" "syncthing"]; initialPassword = "correcthorsebatterystaple"; openssh.authorizedKeys.keys = [ # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect @@ -78,63 +78,13 @@ }; environment.systemPackages = with pkgs; [ - # bitwarden - libreoffice-fresh + bitwarden nextdns - android-tools - gocryptfs - #endless-sky - #gnucash obs-studio kdenlive - rustc - cargo - nodejs rpi-imager - wireshark - appimage-run - #ssb-patchwork - simplex-chat-desktop - #android-studio - #swig - picard kleopatra - qbittorrent - tor-browser - protonvpn-gui - # radicle-cli - # opensnitch-ui - yarn - nodePackages.node-gyp - nodePackages.node-pre-gyp - superTuxKart - openssl xonotic - - # qgis - helix - holehe - smartmontools - cheat - lazygit - ripgrep - jq - yq - neofetch - tldr - bat - dust - powertop - fzf - atuin - zellij - eza - lapce - gotty - gping - yazi - - tildefriends ]; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion diff --git a/hosts/phoenix/configuration.nix b/hosts/phoenix/configuration.nix index c701e76..ab37070 100644 --- a/hosts/phoenix/configuration.nix +++ b/hosts/phoenix/configuration.nix @@ -6,6 +6,8 @@ imports = [ ./hardware-configuration.nix ../../common/default.nix + ../../common/full-install.nix + ../../common/allow-unfree.nix ../../common/locales/en.nix ../../common/locales/fr-keymap.nix @@ -21,6 +23,8 @@ # If you want to use modules your own flake exports (from modules/nixos): # outputs.nixosModules.example + ../../modules/nixos/vedirect-reader.nix + # Or modules from other flakes (such as nixos-hardware): # inputs.hardware.nixosModules.common-cpu-amd # inputs.hardware.nixosModules.common-ssd @@ -34,15 +38,23 @@ networking = { hostName = "phoenix"; - firewall.enable = true; - firewall.allowedTCPPorts = [8080 12345 13378]; - firewall.allowedUDPPorts = [8080]; + firewall = { + enable = true; + allowedTCPPorts = [ + 8080 # ? + 12345 # tildefriends + 13378 # audiobookshelf + ]; + allowedUDPPorts = [ + 8080 # ? + ]; + }; }; users.users.user = { isNormalUser = true; description = "User"; - extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"]; + extraGroups = ["networkmanager" "wheel" "syncthing"]; initialPassword = "correcthorsebatterystaple"; openssh.authorizedKeys.keys = [ # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect @@ -55,8 +67,10 @@ fileSystems = ["/" "/data"]; }; + # services.vedirect-reader.enable = true; + virtualisation.docker.enable = true; - services.flatpak.enable = true; + services.flatpak.enable = false; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. @@ -77,24 +91,24 @@ configDir = lib.mkForce "/data/sync/configuration/"; }; + # Needed to build enry boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; environment.systemPackages = with pkgs; [ bitwarden - libreoffice-fresh nextdns - android-tools + # android-tools gocryptfs #endless-sky #gnucash - obs-studio - kdenlive + # obs-studio + # kdenlive rustc cargo nodejs rpi-imager - wireshark - appimage-run + # wireshark + # appimage-run #ssb-patchwork simplex-chat-desktop #android-studio @@ -109,7 +123,7 @@ yarn nodePackages.node-gyp nodePackages.node-pre-gyp - superTuxKart + # superTuxKart openssl # qgis diff --git a/hosts/stuff/configuration.nix b/hosts/stuff/configuration.nix index 80f328e..1ebfb5e 100644 --- a/hosts/stuff/configuration.nix +++ b/hosts/stuff/configuration.nix @@ -16,7 +16,7 @@ users.users.user = { isNormalUser = true; description = "User"; - extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"]; + extraGroups = ["networkmanager" "wheel" "syncthing"]; initialPassword = "correcthorsebatterystaple"; openssh.authorizedKeys.keys = [ # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100644 index 45aae31..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -# 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/nixos/default.nix b/modules/nixos/default.nix index 8605069..ae89030 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -2,5 +2,6 @@ # 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; + tildefriends = import ./tildefriends.nix; + vedirect-reader = import ./vedirect-reader.nix; } diff --git a/modules/nixos/tildefriends.nix b/modules/nixos/tildefriends.nix new file mode 100644 index 0000000..24a9020 --- /dev/null +++ b/modules/nixos/tildefriends.nix @@ -0,0 +1,34 @@ +{ + lib, + pkgs, + config, + ... +}: +with lib; let + # WORK IN PROGRESS + # WORK IN PROGRESS + # WORK IN PROGRESS + # Shorter name to access final settings a + # user of hello.nix module HAS ACTUALLY SET. + # cfg is a typical convention. + cfg = config.services.hello; +in { + # Declare what settings a user of this "hello.nix" module CAN SET. + options.services.hello = { + enable = mkEnableOption "hello service"; + greeter = mkOption { + type = types.str; + default = "world"; + }; + }; + + # Define what other settings, services and resources should be active IF + # a user of this "hello.nix" module ENABLED this module + # by setting "services.hello.enable = true;". + config = mkIf cfg.enable { + systemd.services.hello = { + wantedBy = ["multi-user.target"]; + serviceConfig.ExecStart = "${pkgs.hello}/bin/hello -g'Hello, ${escapeShellArg cfg.greeter}!'"; + }; + }; +} diff --git a/modules/nixos/vedirect-reader.nix b/modules/nixos/vedirect-reader.nix new file mode 100644 index 0000000..c2c740b --- /dev/null +++ b/modules/nixos/vedirect-reader.nix @@ -0,0 +1,30 @@ +{ + lib, + pkgs, + config, + ... +}: +with lib; let + # WORK IN PROGRESS + # WORK IN PROGRESS + # WORK IN PROGRESS + # Shorter name to access final settings a + # user of hello.nix module HAS ACTUALLY SET. + # cfg is a typical convention. + cfg = config.services.vedirect-reader; +in { + # Declare what settings a user of this "hello.nix" module CAN SET. + options.services.vedirect-reader = { + enable = mkEnableOption "vedirect-reader"; + }; + + # Define what other settings, services and resources should be active IF + # a user of this "hello.nix" module ENABLED this module + # by setting "services.hello.enable = true;". + config = mkIf cfg.enable { + systemd.services.vedirect-reader = { + wantedBy = ["multi-user.target"]; + serviceConfig.ExecStart = "node ${pkgs.vedirect-reader}/lib/node_modules/vedirect-reader/main.js"; + }; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 96ffce6..a16a90b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,4 +2,5 @@ # You can build them using 'nix build .#example' {pkgs, ...}: { tildefriends = pkgs.callPackage ./tildefriends/default.nix {}; + vedirect-reader = pkgs.callPackage ./vedirect-reader/default.nix {}; } diff --git a/pkgs/vedirect-reader/default.nix b/pkgs/vedirect-reader/default.nix new file mode 100644 index 0000000..d18f086 --- /dev/null +++ b/pkgs/vedirect-reader/default.nix @@ -0,0 +1,31 @@ +{ + lib, + buildNpmPackage, + fetchFromGitea, +}: +buildNpmPackage rec { + pname = "vedirect-reader"; + version = "0.0.0"; + + src = fetchFromGitea { + domain = "gitea.com"; + owner = "tasiaiso"; + repo = "vedirect-reader"; + rev = "1c0497872f3ef9418bb4a1f2cd08d00b86af8f65"; + hash = "sha256-M27lk04Mwwvgu8fjV+tAAbCkzcB3QJuplOt5k/NQ00I="; + }; + + npmDepsHash = "sha256-oUFinl22QvMZutAY+FwQiAQqrQevObbsLLCNzWnAVxA="; + dontNpmBuild = true; + + # doCheck = false; + + # meta = { + # homepage = "https://tildefriends.net"; + # description = "Make apps and friends from the comfort of your web browser."; + # mainProgram = "tildefriends"; + # license = with lib.licenses; [mit]; + # maintainers = with lib.maintainers; [tasiaiso]; + # platforms = lib.platforms.all; + # }; +}