diff --git a/configuration.nix b/configuration.nix index 423eda1..0a9b988 100644 --- a/configuration.nix +++ b/configuration.nix @@ -11,6 +11,7 @@ ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; + powerManagement.enable = false; # Bootloader. boot.loader.grub.enable = true; @@ -26,6 +27,14 @@ # Enable networking networking.networkmanager.enable = true; + services.tailscale = { + enable =true; + useRoutingFeatures = "server"; + extraUpFlags = [ + "--advertise-exit-node" + "--exit-node" + ]; + }; # Set your time zone. time.timeZone = "Europe/Stockholm"; @@ -51,10 +60,11 @@ # Enable the XFCE Desktop Environment. # services.xserver.displayManager.lightdm.enable = true; # services.xserver.desktopManager.xfce.enable = true; + services.xserver.desktopManager.plasma5.enable = true; # Enable automatic login for the user. - # services.xserver.displayManager.autoLogin.enable = true; - # services.xserver.displayManager.autoLogin.user = "sondell"; + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "sondell"; # Configure keymap in X11 services.xserver = { @@ -108,12 +118,26 @@ environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget + filebrowser git helix - fish - + nil + starship ]; + programs.fish= { + enable=true; + shellInit = "starship init fish | source"; + }; + programs.starship.enable = true; + programs.starship.settings = { + shell = { + disabled = false; + fish_indicator = ""; + bash_indicator = "BASH"; + }; + }; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/filebrowser.nix b/filebrowser.nix new file mode 100644 index 0000000..5cf3325 --- /dev/null +++ b/filebrowser.nix @@ -0,0 +1,34 @@ +{ config, pkgs, ... }: + +let + domain = "files.sondell.org"; +in +{ + systemd.services.filebrowser = with pkgs; { + enable = true; + description = "web app file explorer"; + wantedBy = [ "multi-user.target" ]; + unitConfig = { + After="network-online.target"; + }; + serviceConfig = { + ExecStart = "${filebrowser}/bin/filebrowser -r /mnt/movie_drive -d /var/lib/filebrowser/filebrowser.db"; + User= "jellyfin"; + Type= "simple"; + }; + }; + + + services.nginx.virtualHosts.${domain} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:8080/"; + proxyWebsockets = true; + # extraConfig = '' + # access_log /var/log/nginx/access.log main if=$forgejo_access_log; + # ''; + }; + }; +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1bb48ae --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1709237383, + "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 19cd770..62d71f8 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,14 @@ nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = attrs; - modules = [ ./configuration.nix ./forgejo.nix ./nextcloud.nix ./audiobooks.nix ./jellyfin.nix ]; + modules = [ + ./configuration.nix + ./forgejo.nix + ./nextcloud.nix + ./audiobooks.nix + ./jellyfin.nix + ./filebrowser.nix + ]; }; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 74125e0..eb96fdf 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -8,8 +8,8 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "pata_jmicron" "usbhid" "usb_storage" "floppy" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "pata_jmicron" "usbhid" "floppy" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; @@ -17,6 +17,11 @@ { device = "/dev/disk/by-uuid/a0be6182-8c58-4cac-b2c4-58148b1847e8"; fsType = "ext4"; }; + fileSystems."/mnt/movie_drive" = + { device = "/dev/disk/by-uuid/f3463885-fde8-4488-9442-37ced2b2c8f3"; + fsType = "ext4"; + }; + swapDevices = [ ]; @@ -26,6 +31,7 @@ # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/nextcloud.nix b/nextcloud.nix index 4b883a2..02d9610 100644 --- a/nextcloud.nix +++ b/nextcloud.nix @@ -23,6 +23,7 @@ in # acmeRoot = null; }; }; + postgresql.enable = true; # nextcloud = { enable = true;