diff --git a/desktop/cosmic.nix b/desktop/cosmic.nix index 335fe10..6a8a1c0 100644 --- a/desktop/cosmic.nix +++ b/desktop/cosmic.nix @@ -1,8 +1,10 @@ -{ pkgs, lib, ... }: +{ inputs, lib, ... }: { - services.desktopManager.cosmic.enable = true; + imports = [ inputs.nixos-cosmic.nixosModules.default ]; + # TODO at the moment COSMIC cannot be used alongside Gnome + # https://github.com/lilyinstarlight/nixos-cosmic/issues/17 specialisation = { cosmic.configuration = { services.xserver.displayManager.gdm.enable = lib.mkForce false; diff --git a/flake.lock b/flake.lock index 6e0a257..cb3b0a6 100644 --- a/flake.lock +++ b/flake.lock @@ -155,6 +155,22 @@ } }, "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1746162366, + "narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1696426674, @@ -278,16 +294,16 @@ ] }, "locked": { - "lastModified": 1747556831, - "narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=", + "lastModified": 1747331121, + "narHash": "sha256-3MmiUN/jOHBHQUnjqzg6qKArc17j2OS6jisEppDY4g8=", "owner": "nix-community", "repo": "home-manager", - "rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33", + "rev": "1eec32f0efe3b830927989767a9e6ece0d82d608", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } @@ -330,6 +346,29 @@ "type": "github" } }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat_3", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1747566515, + "narHash": "sha256-mBT3EypUn1HZ5iRGDmZQPtVNYxQxnkIsasggSCndYjw=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "93f3add95306179d15f8a6b1cfc87bfdc1702a33", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1747129300, @@ -347,16 +386,32 @@ }, "nixpkgs": { "locked": { - "lastModified": 1747428706, - "narHash": "sha256-XVds9FkRrY59xRNNq14FNsFGqDiexXX/mlHcX4hPyyk=", + "lastModified": 1747335874, + "narHash": "sha256-IKKIXTSYJMmUtE+Kav5Rob8SgLPnfnq4Qu8LyT4gdqQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2e1496bf8652ff4af4e4d4737277f71e4a4f5cb2", + "rev": "ba8b70ee098bc5654c459d6a95dfc498b91ff858", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.05", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1747335874, + "narHash": "sha256-IKKIXTSYJMmUtE+Kav5Rob8SgLPnfnq4Qu8LyT4gdqQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ba8b70ee098bc5654c459d6a95dfc498b91ff858", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } @@ -417,7 +472,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -447,6 +502,7 @@ "flake-utils": "flake-utils", "home-manager": "home-manager_2", "matrix-appservices": "matrix-appservices", + "nixos-cosmic": "nixos-cosmic", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", @@ -455,6 +511,27 @@ "pre-commit-hooks": "pre-commit-hooks" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747535902, + "narHash": "sha256-rKWBtLcqQeu8PpfKIBn1ORXS2udSH/MwnQFwfSpFOLg=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "b7a99615d26b82c39b73ccc9026545c3f3403b71", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 30a3d2f..7d68912 100644 --- a/flake.nix +++ b/flake.nix @@ -4,16 +4,18 @@ rec { nixConfig = { extra-substituters = [ "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" "https://felschr.cachix.org" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" "felschr.cachix.org-1:raomy5XA2tsVkBoG6wo70ARIn+V24IXhWaSe3QZo12A=" ]; }; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -27,7 +29,7 @@ rec { flake-utils.url = "github:numtide/flake-utils"; home-manager = { - url = "github:nix-community/home-manager/release-25.05"; + url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -67,6 +69,11 @@ rec { flake = false; }; + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + openwrt-imagebuilder = { url = "github:astro/nix-openwrt-imagebuilder"; inputs.nixpkgs.follows = "nixpkgs"; @@ -75,7 +82,12 @@ rec { }; outputs = - inputs: + { + self, + nixpkgs, + nixpkgs-unstable, + ... + }@inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" @@ -86,7 +98,7 @@ rec { ./lib/flake-module.nix ./hosts/flake-module.nix ./home/flake-module.nix - ./overlays/flake-module.nix + ./overlays.nix ]; flake = { inherit nixConfig; @@ -105,6 +117,11 @@ rec { ... }: { + _module.args.pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + devShells.default = pkgs.mkShell { inherit (config.checks.pre-commit) shellHook; }; checks = { @@ -112,10 +129,7 @@ rec { src = ./.; hooks = { nixfmt-rfc-style.enable = true; - shellcheck = { - enable = true; - excludes = [ ".envrc" ]; - }; + shellcheck.enable = true; }; }; }; diff --git a/home/browsers/firefox.nix b/home/browsers/firefox.nix index 7f551a3..2b1dd05 100644 --- a/home/browsers/firefox.nix +++ b/home/browsers/firefox.nix @@ -65,16 +65,15 @@ in private = { id = 0; extraConfig = sharedExtraConfig; - extensions.packages = commonExtensions; + extensions = commonExtensions; }; work = { id = 1; extraConfig = sharedExtraConfig; - extensions.packages = + extensions = commonExtensions ++ (with firefox-addons; [ - # dashlane - # bitwarden + bitwarden react-devtools reduxdevtools ]); diff --git a/home/browsers/mullvad-browser.nix b/home/browsers/mullvad-browser.nix index f5614c7..d5d5bf2 100644 --- a/home/browsers/mullvad-browser.nix +++ b/home/browsers/mullvad-browser.nix @@ -50,145 +50,124 @@ let commonSearch = { force = true; # TODO defaults don't work - default = "qwant"; - privateDefault = "qwant"; + default = "Qwant"; + privateDefault = "Qwant"; order = [ - "qwant" - "ecosia" - "ddg" - "startpage" + "Qwant" + "Ecosia" + "DuckDuckGo" + "Startpage" "kagi" ]; engines = { # builtin - startpage.metaData.alias = "@s"; - ddg.metaData.alias = "@d"; + "Startpage".metaData.alias = "@s"; + "DuckDuckGo".metaData.alias = "@d"; # extra - qwant = { - name = "Qwant"; + "Qwant" = { urls = [ { template = "https://www.qwant.com/?q={searchTerms}"; } ]; - iconMapObj."16" = "https://www.qwant.com/favicon.ico"; + iconURL = "https://www.qwant.com/favicon.ico"; definedAliases = [ "@q" ]; }; - ecosia = { - name = "Ecosia"; + "Ecosia" = { urls = [ { template = "https://www.ecosia.org/search?q={searchTerms}"; } ]; - iconMapObj."16" = "https://www.ecosia.org/favicon.ico"; + iconURL = "https://www.ecosia.org/favicon.ico"; definedAliases = [ "@e" ]; }; - kagi = { - name = "Kagi"; + "kagi" = { urls = [ { template = "https://kagi.com/search?q={searchTerms}"; } ]; - iconMapObj."16" = "https://kagi.com/favicon.ico"; + iconURL = "https://kagi.com/favicon.ico"; definedAliases = [ "@k" ]; }; - github = { - name = "GitHub"; + "GitHub" = { urls = [ { template = "https://github.com/search?q={searchTerms}"; } ]; - iconMapObj."16" = "https://github.com/favicon.ico"; + iconURL = "https://github.com/favicon.ico"; definedAliases = [ "@gh" ]; }; - gitlab = { - name = "GitLab"; + "GitLab" = { urls = [ { template = "https://gitlab.com/search?search={searchTerms}"; } ]; - iconMapObj."16" = "https://gitlab.com/favicon.ico"; + iconURL = "https://gitlab.com/favicon.ico"; definedAliases = [ "@gl" ]; }; - codeberg = { - name = "Codeberg"; + "Codeberg" = { urls = [ { template = "https://codeberg.org/explore/repos?q={searchTerms}"; } ]; - iconMapObj."16" = "https://codeberg.org/favicon.ico"; + iconURL = "https://codeberg.org/favicon.ico"; definedAliases = [ "@cb" ]; }; - nix-packages = { - name = "Nix Packages"; + "Nix Packages" = { urls = [ { template = "https://search.nixos.org/packages?query={searchTerms}"; } ]; icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; - nixos-options = { - name = "NixOS Options"; + "NixOS Options" = { urls = [ { template = "https://search.nixos.org/options?query={searchTerms}"; } ]; icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }; - nix-flakes-packages = { - name = "Nix Flakes: Packages"; + "Nix Flakes: Packages" = { urls = [ { template = "https://search.nixos.org/flakes?type=packages&query={searchTerms}"; } ]; icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@nfp" ]; }; - nix-flakes-options = { - name = "Nix Flakes: Options"; + "Nix Flakes: Options" = { urls = [ { template = "https://search.nixos.org/flakes?type=options&query={searchTerms}"; } ]; icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@nfo" ]; }; - nixos-wiki = { - name = "NixOS Wiki"; + "NixOS Wiki" = { urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@nw" ]; }; - crates-io = { - name = "Crates.io"; + "Crates.io" = { urls = [ { template = "https://crates.io/search?q={searchTerms}"; } ]; - iconMapObj."16" = "https://crates.io/favicon.ico"; + iconURL = "https://crates.io/favicon.ico"; definedAliases = [ "@rc" ]; }; - docs-rs = { - name = "Docs.rs"; + "Docs.rs" = { urls = [ { template = "https://docs.rs/releases/search?query={searchTerms}"; } ]; - iconMapObj."16" = "https://docs.rs/favicon.ico"; + iconURL = "https://docs.rs/favicon.ico"; definedAliases = [ "@rd" ]; }; - rust-book = { - name = "Rust Book"; + "Rust Book" = { urls = [ { template = "https://doc.rust-lang.org/book/?search={searchTerms}"; } ]; - iconMapObj."16" = "https://doc.rust-lang.org/book/favicon.svg"; + iconURL = "https://doc.rust-lang.org/book/favicon.svg"; definedAliases = [ "@rb" ]; }; - rust-std = { - name = "Rust std"; + "Rust std" = { urls = [ { template = "https://doc.rust-lang.org/stable/std/?search={searchTerms}"; } ]; - iconMapObj."16" = "https://www.rust-lang.org/static/images/favicon.svg"; + iconURL = "https://www.rust-lang.org/static/images/favicon.svg"; definedAliases = [ "@rs" ]; }; - npm = { - name = "npm"; + "npm" = { urls = [ { template = "https://www.npmjs.com/search?q={searchTerms}"; } ]; - iconMapObj."16" = "https://static-production.npmjs.com/da3ab40fb0861d15c83854c29f5f2962.png"; + iconURL = "https://static-production.npmjs.com/da3ab40fb0861d15c83854c29f5f2962.png"; definedAliases = [ "@npm" ]; }; - pypi = { - name = "PyPI"; + "PyPI" = { urls = [ { template = "https://pypi.org/search/?q={searchTerms}"; } ]; - iconMapObj."16" = "https://pypi.org/favicon.ico"; + iconURL = "https://pypi.org/favicon.ico"; definedAliases = [ "@pypi" ]; }; - stack-overflow = { - name = "Stack Overflow"; + "Stack Overflow" = { urls = [ { template = "https://stackoverflow.com/search?q={searchTerms}"; } ]; - iconMapObj."16" = "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico"; + iconURL = "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico"; definedAliases = [ "@so" ]; }; - wikipedia = { - name = "Wikipedia"; + "Wikipedia" = { urls = [ { template = "https://en.wikipedia.org/wiki/{searchTerms}"; } ]; - iconMapObj."16" = "https://en.wikipedia.org/favicon.ico"; + iconURL = "https://en.wikipedia.org/favicon.ico"; definedAliases = [ "@w" ]; }; - wolfram-alpha = { - name = "Wolfram Alpha"; + "Wolfram Alpha" = { urls = [ { template = "https://www.wolframalpha.com/input?i={searchTerms}"; } ]; - iconMapObj."16" = "https://www.wolframalpha.com/_next/static/images/favicon_1zbE9hjk.ico"; + iconURL = "https://www.wolframalpha.com/_next/static/images/favicon_1zbE9hjk.ico"; definedAliases = [ "@wa" ]; }; - reddit = { - name = "Reddit"; + "Reddit" = { urls = [ { template = "https://www.reddit.com/search/?q={searchTerms}"; } ]; - iconMapObj."16" = "https://www.reddit.com/favicon.ico"; + iconURL = "https://www.reddit.com/favicon.ico"; definedAliases = [ "@r" ]; }; }; @@ -212,12 +191,13 @@ in id = 0; settings = commonSettings; search = commonSearch; - extensions.packages = commonExtensions; + extensions = commonExtensions; }; work = { id = 1; settings = commonSettings; - extensions.packages = + search = commonSearch; + extensions = commonExtensions ++ (with firefox-addons; [ bitwarden diff --git a/home/desktop/mimeapps.nix b/home/desktop/mimeapps.nix index d974caf..901b0f1 100644 --- a/home/desktop/mimeapps.nix +++ b/home/desktop/mimeapps.nix @@ -26,7 +26,7 @@ let pdf = [ "re.sonny.Junction.desktop" ] ++ browsers; ebook = [ "com.github.johnfactotum.Foliate.desktop" ]; magnet = [ "transmission-gtk.desktop" ]; - signal = [ "signal.desktop" ]; + signal = [ "signal-desktop.desktop" ]; }; mimeMap = { @@ -89,7 +89,7 @@ let pdf = [ "application/pdf" ]; ebook = [ "application/epub+zip" ]; magnet = [ "x-scheme-handler/magnet" ]; - signal = [ "signal.desktop" ]; + signal = [ "signal-desktop.desktop" ]; }; associations = diff --git a/home/felschr-server.nix b/home/felschr-server.nix index 82c0de5..068d8fb 100644 --- a/home/felschr-server.nix +++ b/home/felschr-server.nix @@ -26,9 +26,9 @@ sshKeys = [ "3C48489F3B0FBB44E72180D4B1D7541C201C9987" ]; defaultCacheTtl = 600; defaultCacheTtlSsh = 600; - pinentry.package = pkgs.pinentry-curses; + pinentryPackage = pkgs.pinentry-curses; }; - programs.zsh.initContent = '' + programs.zsh.initExtra = '' export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh ''; @@ -38,5 +38,11 @@ programs.git.defaultProfile = "private"; - home.stateVersion = "25.05"; + xdg.configFile."nixpkgs/config.nix".text = '' + { + allowUnfree = true; + } + ''; + + home.stateVersion = "24.11"; } diff --git a/home/felschr-work.nix b/home/felschr-work.nix index 43fd5e1..6d7011e 100644 --- a/home/felschr-work.nix +++ b/home/felschr-work.nix @@ -28,9 +28,9 @@ with pkgs; sshKeys = [ "8A6213DCDAF86BD3A63549FCFDF71B2C92DAE02C" ]; defaultCacheTtl = 600; defaultCacheTtlSsh = 600; - pinentry.package = pkgs.pinentry-gnome3; + pinentryPackage = pkgs.pinentry-gnome3; }; - programs.zsh.initContent = '' + programs.zsh.initExtra = '' export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh ''; @@ -40,6 +40,12 @@ with pkgs; defaultProfile = "work"; }; + xdg.configFile."nixpkgs/config.nix".text = '' + { + allowUnfree = true; + } + ''; + home.packages = with pkgs; [ fh @@ -69,5 +75,5 @@ with pkgs; emblem ]; - home.stateVersion = "25.05"; + home.stateVersion = "24.11"; } diff --git a/home/felschr.nix b/home/felschr.nix index 49eb332..f5ee504 100644 --- a/home/felschr.nix +++ b/home/felschr.nix @@ -28,9 +28,9 @@ ]; defaultCacheTtl = 600; defaultCacheTtlSsh = 600; - pinentry.package = pkgs.pinentry-gnome3; + pinentryPackage = pkgs.pinentry-gnome3; }; - programs.zsh.initContent = '' + programs.zsh.initExtra = '' export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh ''; @@ -38,6 +38,12 @@ programs.git.defaultProfile = "private"; + xdg.configFile."nixpkgs/config.nix".text = '' + { + allowUnfree = true; + } + ''; + home.packages = with pkgs; [ # system gparted @@ -50,6 +56,9 @@ tabbed curtail + # work + teams-for-linux + # dev & admin pods # gaphor @@ -73,10 +82,11 @@ raider gnome-obfuscate yubikey-manager - yubioath-flutter + yubikey-manager-qt + # yubioath-flutter # TODO conflicts with fluffychat magic-wormhole-rs - localsend - onionshare-gui + warp + # onionshare-gui transmission_4-gtk unstable.qbittorrent fragments @@ -90,5 +100,5 @@ emblem ]; - home.stateVersion = "25.05"; + home.stateVersion = "24.11"; } diff --git a/home/flake-module.nix b/home/flake-module.nix index f6b54ac..6722451 100644 --- a/home/flake-module.nix +++ b/home/flake-module.nix @@ -1,38 +1,24 @@ { self, inputs, - lib, + pkgs, ... }: let - mkHomeConfiguration = - { - user, - system, - modules, - }: - inputs.home-manager.lib.homeManagerConfiguration { - pkgs = self.pkgsFor system; - extraSpecialArgs = { inherit inputs; }; - - modules = - (with self.homeModules; [ nixpkgs ]) - ++ [ - { - home.username = user; - home.homeDirectory = "/home/${user}"; - } - ] - ++ modules; - }; + createHomeConfig = + name: args: + inputs.home-manager.lib.homeManagerConfiguration ( + { + inherit pkgs; + extraSpecialArgs = { inherit inputs; }; + } + // args + ); in { - imports = [ inputs.home-manager.flakeModules.home-manager ]; - flake = { homeModules = { - nixpkgs = import ./modules/nixpkgs.nix; git = import ./modules/git.nix; firefox = import ./modules/firefox/firefox.nix; tor-browser = import ./modules/firefox/tor-browser.nix; @@ -44,31 +30,26 @@ in felschr-work = import ./felschr-work.nix; }; homeConfigurations = { - felschr = mkHomeConfiguration { - user = "felschr"; - system = "x86_64-linux"; + felschr = createHomeConfig { modules = [ self.homeModules.git self.homeModules.felschr ]; }; - felschr-server = mkHomeConfiguration { - user = "felschr"; - system = "x86_64-linux"; + felschr-server = createHomeConfig { modules = [ self.homeModules.git self.homeModules.felschr-server ]; }; - felschr-work = mkHomeConfiguration { - user = "felschr"; - system = "x86_64-linux"; + felschr-work = createHomeConfig { modules = [ self.homeModules.git self.homeModules.felschr-work ]; }; }; - homeManagerModules = lib.warn "`homeManagerModules` is deprecated. Use `homeModules` instead." self.homeModules; + # HINT alias for deprecated output + homeManagerModules = self.homeModules; }; } diff --git a/home/modules/nixpkgs.nix b/home/modules/nixpkgs.nix deleted file mode 100644 index de2d9c2..0000000 --- a/home/modules/nixpkgs.nix +++ /dev/null @@ -1,11 +0,0 @@ -_: - -{ - nixpkgs.config.allowUnfree = true; - - xdg.configFile."nixpkgs/config.nix".text = '' - { - allowUnfree = true; - } - ''; -} diff --git a/home/shell/zellij.nix b/home/shell/zellij.nix index 03c1740..1555ef8 100644 --- a/home/shell/zellij.nix +++ b/home/shell/zellij.nix @@ -4,7 +4,6 @@ programs.zellij.enable = true; programs.zellij.package = pkgs.unstable.zellij; programs.zellij.enableZshIntegration = true; - programs.zellij.exitShellOnExit = true; programs.zellij.settings = { default_layout = "compact"; # or default default_mode = "normal"; @@ -18,4 +17,8 @@ strider.path = "strider"; }; }; + + home.sessionVariables = { + ZELLIJ_AUTO_EXIT = "true"; + }; } diff --git a/home/shell/zsh.nix b/home/shell/zsh.nix index acd0cb2..d997075 100644 --- a/home/shell/zsh.nix +++ b/home/shell/zsh.nix @@ -29,7 +29,7 @@ in file = "share/zsh-history-substring-search/zsh-history-substring-search.zsh"; } ]; - initContent = '' + initExtra = '' export KEYTIMEOUT=1 ZSH_AUTOSUGGEST_USE_ASYNC=1 diff --git a/home/signal.nix b/home/signal.nix index d355c37..265d6f4 100644 --- a/home/signal.nix +++ b/home/signal.nix @@ -4,7 +4,7 @@ home.packages = with pkgs; [ signal-desktop (makeAutostartItem { - name = "signal"; + name = "signal-desktop"; package = signal-desktop; prependExtraArgs = [ "--start-in-tray" ]; }) diff --git a/hosts/home-pc/default.nix b/hosts/home-pc/default.nix index 2a26cfd..7ff949f 100644 --- a/hosts/home-pc/default.nix +++ b/hosts/home-pc/default.nix @@ -22,6 +22,8 @@ ../../services/open-webui.nix ]; + nixpkgs.config.allowUnfree = true; + boot.loader.systemd-boot.memtest86.enable = true; # running binaries for other architectures diff --git a/hosts/home-server/default.nix b/hosts/home-server/default.nix index e947b56..e8a4eda 100644 --- a/hosts/home-server/default.nix +++ b/hosts/home-server/default.nix @@ -50,6 +50,8 @@ in age.secrets.cloudflare.file = ../../secrets/cloudflare.age; age.secrets.hostKey.file = ../../secrets/home-server/hostKey.age; + nixpkgs.config.allowUnfree = true; + networking.domain = "home.felschr.com"; networking.firewall.allowedTCPPorts = [ diff --git a/overlays.nix b/overlays.nix new file mode 100644 index 0000000..a317b32 --- /dev/null +++ b/overlays.nix @@ -0,0 +1,14 @@ +{ inputs, ... }: + +{ + flake = { + overlays.default = final: prev: { + unstable = import inputs.nixpkgs-unstable { + inherit (prev) system; + config.allowUnfree = true; + }; + inherit (inputs.self.packages.${prev.system}) deconz brlaser; + vimPlugins = prev.vimPlugins // final.callPackage ./pkgs/vim-plugins { inherit inputs; }; + }; + }; +} diff --git a/overlays/flake-module.nix b/overlays/flake-module.nix deleted file mode 100644 index 8eabafb..0000000 --- a/overlays/flake-module.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ self, inputs, ... }: - -{ - flake = { - overlays.default = final: prev: { - unstable = import inputs.nixpkgs-unstable { - inherit (prev) system; - config.allowUnfree = true; - }; - inherit (inputs.self.packages.${prev.system}) deconz; - vimPlugins = prev.vimPlugins // final.callPackage ../pkgs/vim-plugins { inherit inputs; }; - }; - pkgsFor = - system: - import inputs.nixpkgs { - inherit system; - overlays = [ self.overlays.default ]; - config.allowUnfree = true; - }; - }; - - perSystem = - { system, ... }: - { - _module.args.pkgs = self.pkgsFor system; - }; -} diff --git a/pkgs/brlaser/default.nix b/pkgs/brlaser/default.nix new file mode 100644 index 0000000..5b98d51 --- /dev/null +++ b/pkgs/brlaser/default.nix @@ -0,0 +1,119 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + zlib, + cups, + ... +}: + +# maintained fork of brlaser with newer drivers (including Brother HL-L2370DN) +stdenv.mkDerivation (finalAttrs: { + pname = "brlaser"; + version = "6.2.6"; + + src = fetchFromGitHub { + owner = "Owl-Maintain"; + repo = "brlaser"; + rev = "v${finalAttrs.version}"; + hash = "sha256-+W84s3Nulj0kz2h1WE7/QGysVylKkN/xNqcNvrQz6D8="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ + zlib + cups + ]; + + cmakeFlags = [ + "-DCUPS_SERVER_BIN=lib/cups" + "-DCUPS_DATA_DIR=share/cups" + ]; + + meta = with lib; { + description = "A CUPS driver for Brother laser printers"; + longDescription = '' + While most Brother printers can use standard printer languages like PCL or PostScript, some models do not. If you have a monochrome Brother laser printer (or multi-function device) and the other open-source drivers are not working, brlaser might be able to help. Additionally, there have been reports of some non-Brother printers working with this driver. + + The following printers have been reported to work with this driver: + + Brother DCP-1510 series + Brother DCP-1600 series + Brother DCP-1610W series + Brother DCP-7020 + Brother DCP-7030 + Brother DCP-7040 + Brother DCP-7055 + Brother DCP-7055W + Brother DCP-7060D + Brother DCP-7065DN + Brother DCP-7070DW + Brother DCP-7080 + Brother DCP-7080D + Brother DCP-8065DN + Brother DCP-L2500D series + Brother DCP-L2510D series + Brother DCP-L2520D series + Brother DCP-L2520DW series + Brother DCP-L2537DW + Brother DCP-L2540DW series + Brother DCP-L2550DW series + Brother FAX-2820 + Brother FAX-2840 + Brother HL-1110 series + Brother HL-1200 series + Brother HL-2030 series + Brother HL-2130 series + Brother HL-2140 series + Brother HL-2220 series + Brother HL-2230 series + Brother HL-2240D series + Brother HL-2250DN series + Brother HL-2260 + Brother HL-2270DW series + Brother HL-2280DW + Brother HL-5030 series + Brother HL-5040 series + Brother HL-L2300D series + Brother HL-L2305 series + Brother HL-L2310D series + Brother HL-L2320D series + Brother HL-L2335D series + Brother HL-L2340D series + Brother HL-L2350DW series + Brother HL-L2360D series + Brother HL-L2370DN series + Brother HL-L2375DW series + Brother HL-L2380DW series + Brother HL-L2390DW + Brother HL-L5000D series + Brother MFC-1810 series + Brother MFC-1910W series + Brother MFC-7240 + Brother MFC-7320 + Brother MFC-7340 + Brother MFC-7360N + Brother MFC-7365DN + Brother MFC-7420 + Brother MFC-7440N + Brother MFC-7460DN + Brother MFC-7860DW + Brother MFC-8710DW + Brother MFC-8860DN + Brother MFC-9160 + Brother MFC-L2700DN series + Brother MFC-L2700DW series + Brother MFC-L2710DN series + Brother MFC-L2710DW series + Brother MFC-L2750DW series + Fuji Xerox DocuPrint P265 dw + Lenovo LJ2650DN + ''; + homepage = "https://github.com/Owl-Maintain/brlaser"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ felschr ]; + changelog = "https://github.com/Owl-Maintain/brlaser/releases/tag/${finalAttrs.src.rStijnDWev}"; + }; +}) diff --git a/pkgs/flake-module.nix b/pkgs/flake-module.nix index b97b0fd..4dabd8b 100644 --- a/pkgs/flake-module.nix +++ b/pkgs/flake-module.nix @@ -4,6 +4,7 @@ { self', pkgs, ... }: { packages = { + brlaser = pkgs.callPackage ./brlaser { }; deconz = pkgs.qt5.callPackage ./deconz { }; }; diff --git a/scripts/create-gpg-key b/scripts/create-gpg-key index 31aeb09..eac9946 100755 --- a/scripts/create-gpg-key +++ b/scripts/create-gpg-key @@ -1,39 +1,21 @@ -#! /usr/bin/env bash +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p bash gnupg # shellcheck shell=bash set -euo pipefail -read -rp 'enter email address: ' email +EMAIL=$0 -echo "$email" - -# create main key -gpg2 --quick-gen-key "Felix Schröter <$email>" ed25519 sign 1y || true - -keyid=$(gpg2 --list-keys --with-colons "$email" | grep "^pub:" | cut -d: -f5) -fpr=$(gpg2 --list-keys --with-colons "$email" | grep "^fpr:" | cut -d: -f10) +# create master key +gpg2 --quick-gen-key "Felix Schröter <$EMAIL>" ed25519 sign 1y # create subkeys -gpg2 --quick-add-key "$fpr" cv25519 encr 1y -gpg2 --quick-add-key "$fpr" ed25519 auth 1y -gpg2 --quick-add-key "$fpr" ed25519 sign 1y +gpg2 --quick-add-key KEYID cv25519 encr 1y +gpg2 --quick-add-key KEYID ed25519 auth 1y +gpg2 --quick-add-key KEYID ed25519 sign 1y -echo "created keys:" -gpg2 --list-keys --with-subkey-fingerprint "$keyid" +# for signing git commits use the sign subkey +# and add the public sign subkey to GitHub/GitLab -sign=$(gpg2 --list-keys --with-colons "$email" | grep "::s::" -A 1) -sign_keyid=$(echo "$sign" | grep "^sub:" | cut -d: -f5) - -auth=$(gpg2 --list-keys --with-colons "$email" | grep "::a::" -A 1) -auth_keyid=$(echo "$auth" | grep "^sub:" | cut -d: -f5) - -pub_sign=$(gpg2 --armor --export "$sign_keyid!") -pub_ssh=$(gpg2 --export-ssh-key "$auth_keyid") - -echo "public PGP key with signing subkey:" -echo "$pub_sign" -echo "" - -echo "public SSH key for authenticating with git forges:" -echo "$pub_ssh" -echo "" +# show info +gpg2 --list-keys --with-subkey-fingerprint diff --git a/services/authelia.nix b/services/authelia.nix index 011bfb1..ff8e4c3 100644 --- a/services/authelia.nix +++ b/services/authelia.nix @@ -100,7 +100,8 @@ in settings = { theme = "dark"; server = { - address = "tcp://[::1]:${toString port}"; + host = "::1"; + inherit port; }; default_2fa_method = "webauthn"; default_redirection_url = "https://${domain}"; diff --git a/system/fonts.nix b/system/fonts.nix index b3fbb75..496155b 100644 --- a/system/fonts.nix +++ b/system/fonts.nix @@ -6,7 +6,7 @@ noto-fonts-extra noto-fonts-cjk-sans noto-fonts-emoji - nerd-fonts.symbols-only + (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) fira-code ]; fonts.fontconfig.defaultFonts = { diff --git a/system/nix.nix b/system/nix.nix index 3a8a7f5..6cdf0c9 100644 --- a/system/nix.nix +++ b/system/nix.nix @@ -4,8 +4,6 @@ let inherit (inputs.self.outputs) nixConfig; in { - nixpkgs.config.allowUnfree = true; - nix.gc = { automatic = true; dates = "04:00"; diff --git a/system/sound.nix b/system/sound.nix index d9ef316..75a1b7b 100644 --- a/system/sound.nix +++ b/system/sound.nix @@ -6,8 +6,8 @@ }: { + hardware.pulseaudio.enable = false; security.rtkit.enable = true; - services.pulseaudio.enable = false; services.pipewire = { enable = true; alsa.enable = true;