diff --git a/flake.nix b/flake.nix index 964a73cf..78f6142e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { # Nixpkgs - nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; @@ -128,8 +128,7 @@ litePkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ - agenix.overlays.default - unstableOverlay # Remove once updated to 23.05 (used for microbin on helix) + ag serviceenix.overlays.default tidalcycles.overlays.default # needed for nvim which comes pre-installed lol ]; }); @@ -172,6 +171,7 @@ home-manager.nixosModules.home-manager { nix.registry.nixpkgs.flake = nixpkgs; + nix.registry.unstable.flake = unstable; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.anish = import ./home/gui; @@ -188,7 +188,7 @@ agenix.nixosModules.age self.nixosModules.backup self.nixosModules.wireguard - self.nixosModules.microbin + # self.nixosModules.microbin disko.nixosModules.disko ]; }; diff --git a/home/profiles/nvim/default.nix b/home/profiles/nvim/default.nix index b28d6a50..ed44f780 100644 --- a/home/profiles/nvim/default.nix +++ b/home/profiles/nvim/default.nix @@ -19,7 +19,7 @@ let sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4="; }; }; - my-lspsaga = pkgs.vimUtils.buildVimPluginFrom2Nix { + my-lspsaga = pkgs.vimUtils.buildVimPlugin { name = "lspsaga.nvim"; src = pkgs.fetchFromGitHub { owner = "glepnir"; @@ -28,7 +28,7 @@ let sha256 = "sciX/fMxzY1YOxXxjj1+ymrdMi451avcFFu+14R+/pk="; }; }; - nvim-luapad = pkgs.vimUtils.buildVimPluginFrom2Nix { + nvim-luapad = pkgs.vimUtils.buildVimPlugin { name = "nvim-luapad"; src = pkgs.fetchFromGitHub { owner = "rafcamlet"; @@ -37,7 +37,7 @@ let sha256 = "gMaS5YFi3+gmUIfkCMEt9vhm8XSgv54Cquv5+WCWeTo="; }; }; - leap = pkgs.vimUtils.buildVimPluginFrom2Nix { + leap = pkgs.vimUtils.buildVimPlugin { name = "leap"; src = pkgs.fetchFromGitHub { owner = "ggandor"; @@ -55,7 +55,7 @@ let sha256 = "vX7ZVJxgatIicmijehtaRvyHxk1i4gFfXrbPM/+VoFc="; }; }; - my-which-key-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { + my-which-key-nvim = pkgs.vimUtils.buildVimPlugin { pname = "which-key.nvim"; version = "2022-05-04"; src = pkgs.fetchFromGitHub { @@ -66,7 +66,7 @@ let }; meta.homepage = "https://github.com/folke/which-key.nvim/"; }; - scnvim = pkgs.vimUtils.buildVimPluginFrom2Nix { + scnvim = pkgs.vimUtils.buildVimPlugin { pname = "scnvim"; version = "2022-06-04"; src = pkgs.fetchFromGitHub { @@ -76,7 +76,7 @@ let sha256 = "kvSwS6FNUY2Ue84NhWLLcm0ldLMSp4WqQ7s6TUoX6Cc="; }; }; - yuck-vim = pkgs.vimUtils.buildVimPluginFrom2Nix { + yuck-vim = pkgs.vimUtils.buildVimPlugin { pname = "yuck.vim"; version = "2021-08-09"; src = pkgs.fetchFromGitHub { @@ -86,7 +86,7 @@ let sha256 = "lp7qJWkvelVfoLCyI0aAiajTC+0W1BzDhmtta7tnICE="; }; }; - nvim-parinfer = pkgs.vimUtils.buildVimPluginFrom2Nix { + nvim-parinfer = pkgs.vimUtils.buildVimPlugin { pname = "nvim-parinfer"; version = "v1.2.0"; src = pkgs.fetchFromGitHub { @@ -96,7 +96,7 @@ let sha256 = "Dlzfp3CZTzq8zQeHByWf3ER6/Em+KNGYNI4Z17ui8Lc="; }; }; - my-marks = pkgs.vimUtils.buildVimPluginFrom2Nix { + my-marks = pkgs.vimUtils.buildVimPlugin { pname = "marks"; version = "2022-08-31"; src = pkgs.fetchFromGitHub { @@ -106,7 +106,7 @@ let sha256 = "XdbgIWuAHNdTfyKDrKmQVq5oSbBoi56DpwtgOqhScAk="; }; }; - my-fterm = pkgs.vimUtils.buildVimPluginFrom2Nix { + my-fterm = pkgs.vimUtils.buildVimPlugin { pname = "fterm"; version = "2022-07-22"; src = pkgs.fetchFromGitHub { @@ -116,7 +116,7 @@ let sha256 = "rR6KDwj58aYfyaSsoUy75536SdBhk394yspCUl/hzfE="; }; }; - my-nvim-peekup = pkgs.vimUtils.buildVimPluginFrom2Nix { + my-nvim-peekup = pkgs.vimUtils.buildVimPlugin { pname = "nvim-peekup"; version = "0.1.0"; src = pkgs.fetchFromGitHub { diff --git a/hosts/box/default.nix b/hosts/box/default.nix index 0c6ceb33..bb593b7d 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -21,7 +21,7 @@ ../profiles/sync/website ../profiles/grasp # ../profiles/archivebox - ../profiles/woodpecker-agent + # ../profiles/woodpecker-agent ../profiles/jellyfin ../profiles/ulogger-server ../profiles/photoprism @@ -51,6 +51,25 @@ # seafile }; + services.transmission = { + enable = true; + settings = { + rpc.bind-address = "0.0.0.0"; + download-dir = "/mnt/two/new-music"; + }; + }; + services.nginx.virtualHosts."transmission.mossnet.lan" = { + enableACME = false; + forceSSL = false; + + locations."/" = { + extraConfig = '' + proxy_pass http://localhost:9091/; + proxy_set_header X-Forwarded-Host $host; + ''; + }; + }; + age.secrets.box-wg.file = "${self}/secrets/box-wg.age"; age.secrets.box-wg.owner = "anish"; age.secrets.borg-key.file = "${self}/secrets/borg-key.age"; diff --git a/hosts/curve/default.nix b/hosts/curve/default.nix index 1c90894f..67a9dee0 100644 --- a/hosts/curve/default.nix +++ b/hosts/curve/default.nix @@ -12,7 +12,7 @@ ../profiles/mimetypes ../profiles/syncthing ../profiles/mossnet-hosts - ../profiles/fly-wg + # ../profiles/fly-wg # ../profiles/kuberenetes # ../profiles/mount-mossnet ]; diff --git a/hosts/helix/default.nix b/hosts/helix/default.nix index c8077e18..62275d04 100644 --- a/hosts/helix/default.nix +++ b/hosts/helix/default.nix @@ -6,9 +6,9 @@ ../profiles/server # ../profiles/metrics ../profiles/gitea - ../profiles/woodpecker-server + # ../profiles/woodpecker-server ../profiles/rss-bridge - ../profiles/mount-mossnet + # ../profiles/mount-mossnet ../profiles/freshrss ../profiles/microbin ]; diff --git a/hosts/profiles/core/default.nix b/hosts/profiles/core/default.nix index e7400180..3c65441a 100644 --- a/hosts/profiles/core/default.nix +++ b/hosts/profiles/core/default.nix @@ -5,7 +5,7 @@ in imports = [ ../../users/anish ]; fonts = { - fonts = with pkgs; [ powerline-fonts dejavu_fonts ]; + packages = with pkgs; [ powerline-fonts dejavu_fonts ]; fontconfig.defaultFonts = { monospace = [ "DejaVu Sans Mono for Powerline" ]; sansSerif = [ "DejaVu Sans" ]; diff --git a/hosts/profiles/desktop/default.nix b/hosts/profiles/desktop/default.nix index 494f525e..156c82cf 100644 --- a/hosts/profiles/desktop/default.nix +++ b/hosts/profiles/desktop/default.nix @@ -69,6 +69,7 @@ in unstable.newsflash unstable.liferea unstable.gh + unstable.flyctl kooha light @@ -122,7 +123,7 @@ in }; xserver = { enable = true; - layout = "us,dvorak"; + xkb.layout = "us,dvorak"; desktopManager.wallpaper.mode = "fill"; displayManager = { defaultSession = "none+bspwm"; @@ -212,7 +213,7 @@ in }; }; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ fira-code fira-code-symbols hermit diff --git a/hosts/profiles/dns/default.nix b/hosts/profiles/dns/default.nix index e43f3bdb..27cf0cef 100644 --- a/hosts/profiles/dns/default.nix +++ b/hosts/profiles/dns/default.nix @@ -33,10 +33,13 @@ let "paper.mossnet.lan" "cal.mossnet.lan" "archive.mossnet.lan" + "headphones.mossnet.lan" + "transmission.mossnet.lan" "tracks.mossnet.lan" "grasp.mossnet.lan" "photos.mossnet.lan" ]; + in { services.unbound = { diff --git a/hosts/profiles/fly-wg/default.nix b/hosts/profiles/fly-wg/default.nix index 6c1d09de..aebdbb42 100644 --- a/hosts/profiles/fly-wg/default.nix +++ b/hosts/profiles/fly-wg/default.nix @@ -1,5 +1,6 @@ { pkgs, config, lib, ... }: { - networking.wg-quick.interfaces.fly-wg.configFile = "/home/anish/usr/fly-test/fly-wg.conf"; + networking.wireguard.interfaces.fly-wg = "/home/anish/usr/fly-io-test/fly-wg.conf"; + # ssh.startAgent = true; } diff --git a/hosts/profiles/freshrss/default.nix b/hosts/profiles/freshrss/default.nix index 4c2590b1..d33a20a7 100644 --- a/hosts/profiles/freshrss/default.nix +++ b/hosts/profiles/freshrss/default.nix @@ -25,9 +25,10 @@ freshrss-users freshrss freshrss ''; ensureDatabases = [ "freshrss" ]; - ensureUsers = [ - { name = "freshrss"; ensurePermissions."DATABASE freshrss" = "ALL PRIVILEGES"; } - ]; + ensureUsers = [{ + name = "freshrss"; + ensureDBOwnership = true; + }]; # TODO # initialScript # set password for freshrss user }; diff --git a/hosts/profiles/gitea/default.nix b/hosts/profiles/gitea/default.nix index 9652c69c..a5f1cb9a 100644 --- a/hosts/profiles/gitea/default.nix +++ b/hosts/profiles/gitea/default.nix @@ -54,11 +54,13 @@ gitea-users gitea gitea ''; ensureDatabases = [ "gitea" ]; - ensureUsers = [ - { name = "gitea"; ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES"; } - ]; + ensureUsers = [{ + name = "gitea"; + ensureDBOwnership = true; + }]; # TODO - # initialScript # set password for gitea user + # initialScript + # set password for gitea user }; services.nginx = { diff --git a/hosts/profiles/headphones/default.nix b/hosts/profiles/headphones/default.nix index c2d2830c..7af396d0 100644 --- a/hosts/profiles/headphones/default.nix +++ b/hosts/profiles/headphones/default.nix @@ -2,11 +2,20 @@ { services.headphones = { enable = true; - host = "192.168.1.240"; + host = "0.0.0.0"; port = 8181; user = "headphones"; group = "audio"; dataDir = "/data/music"; }; - networking.firewall.allowedTCPPorts = [ 8181 ]; + services.nginx.virtualHosts."headphones.mossnet.lan" = { + enableACME = false; + forceSSL = false; + + locations."/" = { + extraConfig = '' + proxy_pass http://127.0.0.1:8181/; + ''; + }; + }; } diff --git a/hosts/profiles/monitoring/default.nix b/hosts/profiles/monitoring/default.nix index cd2251ed..b68e33bb 100644 --- a/hosts/profiles/monitoring/default.nix +++ b/hosts/profiles/monitoring/default.nix @@ -36,6 +36,10 @@ services.postgresql = { ensureUsers = [{ name = "grafana"; + # TODO this is deprecated + # Need to translate this to + # systemd.services.postgresql.postStart + # or initialScript ensurePermissions = { "ALL TABLES IN SCHEMA public" = "SELECT"; "DATABASE wallabag" = "CONNECT"; diff --git a/hosts/profiles/mossnet-hosts/default.nix b/hosts/profiles/mossnet-hosts/default.nix index bba6cc10..9857c692 100644 --- a/hosts/profiles/mossnet-hosts/default.nix +++ b/hosts/profiles/mossnet-hosts/default.nix @@ -4,6 +4,8 @@ 192.168.1.240 mossnet.lan 192.168.1.240 links.mossnet.lan 192.168.1.240 read.mossnet.lan + 192.168.1.240 headphones.mossnet.lan + 192.168.1.240 transmission.mossnet.lan 192.168.1.240 music.mossnet.lan 192.168.1.240 stats.mossnet.lan 192.168.1.240 file.mossnet.lan diff --git a/hosts/profiles/music/default.nix b/hosts/profiles/music/default.nix index 925c6d11..00b7dd9c 100644 --- a/hosts/profiles/music/default.nix +++ b/hosts/profiles/music/default.nix @@ -31,14 +31,14 @@ ]; hardware.pulseaudio.enable = lib.mkForce false; - security.rtkit.enable = true; + security.rtkit.enable = false; services.pipewire = { enable = true; alsa.enable = true; - alsa.support32Bit = true; + alsa.support32Bit = false; pulse.enable = true; - jack.enable = true; + jack.enable = true; # Deprecated as of 23.05 # config = { # pipewire."context.properties"."default.clock.rate" = "48000"; @@ -58,6 +58,6 @@ # "${config.hardware.bluetooth.package}/libexec/bluetooth/bluetoothd --noplugin=sap" #]; boot.kernelModules = [ "snd-seq" "snd-rawmidi" ]; # midi sequence kernel mods - hardware.pulseaudio.package = pkgs.pulseaudio.override { jackaudioSupport = true; }; + # hardware.pulseaudio.package = pkgs.pulseaudio.override { jackaudioSupport = true; }; } diff --git a/hosts/profiles/photoprism/default.nix b/hosts/profiles/photoprism/default.nix index 79160e82..7f9d729d 100644 --- a/hosts/profiles/photoprism/default.nix +++ b/hosts/profiles/photoprism/default.nix @@ -6,9 +6,7 @@ ensureDatabases = [ "photoprism" ]; ensureUsers = [{ name = "photoprism"; - ensurePermissions = { - "DATABASE photoprism" = "ALL PRIVILEGES"; - }; + ensureDBOwnership = true; }]; }; diff --git a/hosts/profiles/ulogger-server/default.nix b/hosts/profiles/ulogger-server/default.nix index f32b2ab1..6fbaee83 100644 --- a/hosts/profiles/ulogger-server/default.nix +++ b/hosts/profiles/ulogger-server/default.nix @@ -6,9 +6,7 @@ ensureDatabases = [ "ulogger" ]; ensureUsers = [{ name = "ulogger"; - ensurePermissions = { - "DATABASE ulogger" = "ALL PRIVILEGES"; - }; + nsureDBOwnership = true; }]; }; diff --git a/hosts/profiles/wallabag/default.nix b/hosts/profiles/wallabag/default.nix index c1e4a4c7..0020eb55 100644 --- a/hosts/profiles/wallabag/default.nix +++ b/hosts/profiles/wallabag/default.nix @@ -14,7 +14,7 @@ ensureUsers = [ { name = "wallabag"; - ensurePermissions."DATABASE wallabag" = "ALL PRIVILEGES"; + ensureDBOwnership = true; } ]; }; diff --git a/hosts/profiles/wireguard-server/default.nix b/hosts/profiles/wireguard-server/default.nix index 6b605a60..bbe87f71 100644 --- a/hosts/profiles/wireguard-server/default.nix +++ b/hosts/profiles/wireguard-server/default.nix @@ -18,7 +18,7 @@ peers = [ { # box - publicKey = "Ra78mOc110K7URN5uB3m9d78iBKgeRHzT+3HkiFp9BU="; + publicKey = "OnvVM1UaX0nmdohzSDyl90VKwd4VUpJZ+4oBpkkytwU="; allowedIPs = [ "10.0.69.4/32" ]; } { diff --git a/hosts/profiles/woodpecker-server/default.nix b/hosts/profiles/woodpecker-server/default.nix index e8357a59..88db666d 100644 --- a/hosts/profiles/woodpecker-server/default.nix +++ b/hosts/profiles/woodpecker-server/default.nix @@ -27,9 +27,7 @@ ensureDatabases = [ "woodpecker" ]; ensureUsers = [{ name = "woodpecker"; - ensurePermissions = { - "DATABASE woodpecker" = "ALL PRIVILEGES"; - }; + ensureDBOwnership = true; }]; }; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index a4e14ac8..1a358e11 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -9,5 +9,5 @@ wireguard = import ./wireguard.nix; backup = import ./backup.nix; ulogger-server = import ./ulogger.nix; - microbin = import ./microbin.nix; + # microbin = import ./microbin.nix; includide in 23.11 } diff --git a/modules/nixos/woodpecker.nix b/modules/nixos/woodpecker.nix index 1d8ae978..99ae4bde 100644 --- a/modules/nixos/woodpecker.nix +++ b/modules/nixos/woodpecker.nix @@ -55,9 +55,7 @@ in ensureDatabases = [ droneserver ]; ensureUsers = [{ name = droneserver; - ensurePermissions = { - "DATABASE ${droneserver}" = "ALL PRIVILEGES"; - }; + ensureDBOwnership = true; }]; };