From 28105b23c0ab5c586830981732dbf3d4de0ab08f Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Mar 2024 08:31:13 +0100 Subject: [PATCH 01/10] use kde --- configuration.nix | 6 ++++-- flake.lock | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 flake.lock diff --git a/configuration.nix b/configuration.nix index 423eda1..f0b067d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -51,10 +51,11 @@ # Enable the XFCE Desktop Environment. # services.xserver.displayManager.lightdm.enable = true; # services.xserver.desktopManager.xfce.enable = true; + services.xserver.desktopManager.kde.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 = { @@ -111,6 +112,7 @@ git helix fish + nil ]; 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 +} From de40392d0c2fedb41c872708bbf0a3b1ea038939 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Mar 2024 10:53:24 +0100 Subject: [PATCH 02/10] fix starship fish --- configuration.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index f0b067d..b41efa1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -51,7 +51,7 @@ # Enable the XFCE Desktop Environment. # services.xserver.displayManager.lightdm.enable = true; # services.xserver.desktopManager.xfce.enable = true; - services.xserver.desktopManager.kde.enable = true; + services.xserver.desktopManager.plasma5.enable = true; # Enable automatic login for the user. services.xserver.displayManager.autoLogin.enable = true; @@ -111,11 +111,23 @@ # wget 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; From ef17814f60e8c8f56ccb577beae30a5c3ae35e98 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Mar 2024 11:00:50 +0100 Subject: [PATCH 03/10] init tailscale --- configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configuration.nix b/configuration.nix index b41efa1..87978f9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -26,6 +26,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"; From 0fce83c2ba2ecf3caa7101cb1c163fdf79b9b9a1 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Mar 2024 16:50:14 +0100 Subject: [PATCH 04/10] disable powerMan --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index 87978f9..e97d2be 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; From befc7c1572bff2562a67000a842f1ce6ff082703 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 2 Mar 2024 17:32:59 +0100 Subject: [PATCH 05/10] explicit add db service --- nextcloud.nix | 1 + 1 file changed, 1 insertion(+) 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; From bd1a4c753adce0325256508ac636e4b092ed162e Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Mar 2024 09:16:42 +0100 Subject: [PATCH 06/10] tailscale network interface --- hardware-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 74125e0..c7f6a44 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -26,6 +26,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; From 109551a5b7bedfbee7a515e9b5162f41e3fe8aa0 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 3 Mar 2024 09:19:19 +0100 Subject: [PATCH 07/10] movie drive --- hardware-configuration.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index c7f6a44..907f675 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/movies" = + { device = "/dev/disk/by-uuid/f3463885-fde8-4488-9442-37ced2b2c8f3"; + fsType = "ext4"; + }; + swapDevices = [ ]; From 6b7f7211e10faa73dbb42b991a5379f6a068ee2c Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Mar 2024 20:10:06 +0100 Subject: [PATCH 08/10] movie drive --- hardware-configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 907f675..eb96fdf 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -17,7 +17,7 @@ { device = "/dev/disk/by-uuid/a0be6182-8c58-4cac-b2c4-58148b1847e8"; fsType = "ext4"; }; - fileSystems."/mnt/movies" = + fileSystems."/mnt/movie_drive" = { device = "/dev/disk/by-uuid/f3463885-fde8-4488-9442-37ced2b2c8f3"; fsType = "ext4"; }; From 4d27e802d84404e0e712749e1f729ae7a4ff5a3d Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Mar 2024 20:48:43 +0100 Subject: [PATCH 09/10] init filebrowser --- filebrowser.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 filebrowser.nix diff --git a/filebrowser.nix b/filebrowser.nix new file mode 100644 index 0000000..d725bd5 --- /dev/null +++ b/filebrowser.nix @@ -0,0 +1,33 @@ +{ config, pkgs, ... }: + +let + domain = "files.sondell.org"; + # derp = "hi"; +in +{ + # + # services.audiobookshelf = { + # enable = true; + # port = 8000; + # }; + systemd.services.fileBrowser = with pkgs; { + enable = true; + description = "web app file explorer"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${filebrowser}/bin/filebrowser -r /mnt/media_drive"; + }; + + + 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; + # ''; + }; + }; +} + From b8e5166a0ff15b78091d8adeef087c9f8875bdaf Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 6 Mar 2024 22:14:44 +0100 Subject: [PATCH 10/10] working filebrowser for jelly files --- configuration.nix | 1 + filebrowser.nix | 17 +++++++++-------- flake.nix | 9 ++++++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/configuration.nix b/configuration.nix index e97d2be..0a9b988 100644 --- a/configuration.nix +++ b/configuration.nix @@ -118,6 +118,7 @@ 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 nil diff --git a/filebrowser.nix b/filebrowser.nix index d725bd5..5cf3325 100644 --- a/filebrowser.nix +++ b/filebrowser.nix @@ -2,19 +2,20 @@ let domain = "files.sondell.org"; - # derp = "hi"; in { - # - # services.audiobookshelf = { - # enable = true; - # port = 8000; - # }; - systemd.services.fileBrowser = with pkgs; { + systemd.services.filebrowser = with pkgs; { enable = true; description = "web app file explorer"; wantedBy = [ "multi-user.target" ]; - serviceConfig.ExecStart = "${filebrowser}/bin/filebrowser -r /mnt/media_drive"; + unitConfig = { + After="network-online.target"; + }; + serviceConfig = { + ExecStart = "${filebrowser}/bin/filebrowser -r /mnt/movie_drive -d /var/lib/filebrowser/filebrowser.db"; + User= "jellyfin"; + Type= "simple"; + }; }; 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 + ]; }; };