From b0a95003b75c0cf6366205c72e315a2b3d41edae Mon Sep 17 00:00:00 2001 From: JuliusFreudenberger Date: Tue, 14 Jan 2025 01:29:24 +0100 Subject: [PATCH] Initial commit --- .gitignore | 6 + README.md | 18 +++ devshells/java17-maven/flake.lock | 64 ++++++++++ devshells/java17-maven/flake.nix | 21 +++ devshells/java21-maven/flake.lock | 64 ++++++++++ devshells/java21-maven/flake.nix | 21 +++ devshells/php8/flake.lock | 64 ++++++++++ devshells/php8/flake.nix | 30 +++++ flake.lock | 120 ++++++++++++++++++ flake.nix | 79 ++++++++++++ home/core.nix | 12 ++ home/direnv/default.nix | 7 + home/gtk/default.nix | 10 ++ home/neovim/default.nix | 40 ++++++ home/xdg/default.nix | 17 +++ home/zsh/default.nix | 33 +++++ hosts/julius-framework/default.nix | 86 +++++++++++++ .../hardware-configuration.nix | 45 +++++++ modules/administration.nix | 12 ++ modules/android.nix | 12 ++ modules/bluetooth.nix | 11 ++ modules/boot-login.nix | 32 +++++ modules/cli-essentials.nix | 23 ++++ modules/connectivity.nix | 12 ++ modules/creativity.nix | 19 +++ modules/desktop-essentials.nix | 30 +++++ modules/distrobox.nix | 11 ++ modules/docker.nix | 11 ++ modules/fingerprint.nix | 9 ++ modules/firmware.nix | 12 ++ modules/flatpak.nix | 22 ++++ modules/fonts.nix | 13 ++ modules/gaming.nix | 14 ++ modules/gui-coding.nix | 17 +++ modules/i3.nix | 58 +++++++++ modules/internet.nix | 28 ++++ modules/laptop.nix | 21 +++ modules/locale.nix | 12 ++ modules/logitech.nix | 12 ++ modules/network.nix | 31 +++++ modules/nix.nix | 22 ++++ modules/office.nix | 28 ++++ modules/optical-media.nix | 12 ++ modules/security.nix | 28 ++++ modules/sync-clients.nix | 11 ++ modules/system.nix | 23 ++++ modules/typesetting.nix | 18 +++ modules/video-and-sound.nix | 22 ++++ overlays/default.nix | 22 ++++ pkgs/default.nix | 6 + pkgs/dlrg-fonts/default.nix | 31 +++++ pkgs/i3-scrot/default.nix | 40 ++++++ pkgs/nemo-nextcloud/default.nix | 57 +++++++++ pkgs/rofirefox/case-sensitivity.patch | 14 ++ pkgs/rofirefox/default.nix | 42 ++++++ users/julius/home.nix | 14 ++ users/julius/nixos.nix | 12 ++ 57 files changed, 1561 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 devshells/java17-maven/flake.lock create mode 100644 devshells/java17-maven/flake.nix create mode 100644 devshells/java21-maven/flake.lock create mode 100644 devshells/java21-maven/flake.nix create mode 100644 devshells/php8/flake.lock create mode 100644 devshells/php8/flake.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/core.nix create mode 100644 home/direnv/default.nix create mode 100644 home/gtk/default.nix create mode 100644 home/neovim/default.nix create mode 100644 home/xdg/default.nix create mode 100644 home/zsh/default.nix create mode 100644 hosts/julius-framework/default.nix create mode 100644 hosts/julius-framework/hardware-configuration.nix create mode 100644 modules/administration.nix create mode 100644 modules/android.nix create mode 100644 modules/bluetooth.nix create mode 100644 modules/boot-login.nix create mode 100644 modules/cli-essentials.nix create mode 100644 modules/connectivity.nix create mode 100644 modules/creativity.nix create mode 100644 modules/desktop-essentials.nix create mode 100644 modules/distrobox.nix create mode 100644 modules/docker.nix create mode 100644 modules/fingerprint.nix create mode 100644 modules/firmware.nix create mode 100644 modules/flatpak.nix create mode 100644 modules/fonts.nix create mode 100644 modules/gaming.nix create mode 100644 modules/gui-coding.nix create mode 100644 modules/i3.nix create mode 100644 modules/internet.nix create mode 100644 modules/laptop.nix create mode 100644 modules/locale.nix create mode 100644 modules/logitech.nix create mode 100644 modules/network.nix create mode 100644 modules/nix.nix create mode 100644 modules/office.nix create mode 100644 modules/optical-media.nix create mode 100644 modules/security.nix create mode 100644 modules/sync-clients.nix create mode 100644 modules/system.nix create mode 100644 modules/typesetting.nix create mode 100644 modules/video-and-sound.nix create mode 100644 overlays/default.nix create mode 100644 pkgs/default.nix create mode 100644 pkgs/dlrg-fonts/default.nix create mode 100644 pkgs/i3-scrot/default.nix create mode 100644 pkgs/nemo-nextcloud/default.nix create mode 100644 pkgs/rofirefox/case-sensitivity.patch create mode 100644 pkgs/rofirefox/default.nix create mode 100644 users/julius/home.nix create mode 100644 users/julius/nixos.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f61d20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +result +result/ +.direnv/ +.DS_Store +.pre-commit-config.yaml +logs/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..deeeadd --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Nix Configuration + +This repository is home to the nix code that builds my systems. + + +## Why Nix? + +Nix allows for easy to manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it. + + +## How to install Nix and Deploy this Flake? + +After installed NixOS with `nix-command` & `flake` enabled, you can deploy this flake with the following command: + +```bash +sudo nixos-rebuild switch .#nixos-test +``` + diff --git a/devshells/java17-maven/flake.lock b/devshells/java17-maven/flake.lock new file mode 100644 index 0000000..ae71305 --- /dev/null +++ b/devshells/java17-maven/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1736684107, + "narHash": "sha256-vH5mXxEvZeoGNkqKoCluhTGfoeXCZ1seYhC2pbMN0sg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "635e887b48521e912a516625eee7df6cf0eba9c1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devshells/java17-maven/flake.nix b/devshells/java17-maven/flake.nix new file mode 100644 index 0000000..106308a --- /dev/null +++ b/devshells/java17-maven/flake.nix @@ -0,0 +1,21 @@ +{ + description = "A basic flake with a shell"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + inputs.systems.url = "github:nix-systems/default"; + inputs.flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { packages = with pkgs; [ maven jdk17 ]; }; + } + ); +} diff --git a/devshells/java21-maven/flake.lock b/devshells/java21-maven/flake.lock new file mode 100644 index 0000000..72a721c --- /dev/null +++ b/devshells/java21-maven/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1734435836, + "narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4989a246d7a390a859852baddb1013f825435cee", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devshells/java21-maven/flake.nix b/devshells/java21-maven/flake.nix new file mode 100644 index 0000000..79f8a2c --- /dev/null +++ b/devshells/java21-maven/flake.nix @@ -0,0 +1,21 @@ +{ + description = "A basic flake with a shell"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + inputs.systems.url = "github:nix-systems/default"; + inputs.flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { packages = with pkgs; [ maven jdk21 ]; }; + } + ); +} diff --git a/devshells/php8/flake.lock b/devshells/php8/flake.lock new file mode 100644 index 0000000..ae71305 --- /dev/null +++ b/devshells/php8/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1736684107, + "narHash": "sha256-vH5mXxEvZeoGNkqKoCluhTGfoeXCZ1seYhC2pbMN0sg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "635e887b48521e912a516625eee7df6cf0eba9c1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devshells/php8/flake.nix b/devshells/php8/flake.nix new file mode 100644 index 0000000..146dfe4 --- /dev/null +++ b/devshells/php8/flake.nix @@ -0,0 +1,30 @@ +{ + description = "A basic flake with a shell"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + inputs.systems.url = "github:nix-systems/default"; + inputs.flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { packages = with pkgs; [ (php81.buildEnv { + extensions = ({ enabled, all }: enabled ++ (with all; [ + xdebug + ])); + extraConfig = '' + xdebug.mode=debug + ''; + }) + php81Packages.composer + ]; }; + } + ); +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..cd5906d --- /dev/null +++ b/flake.lock @@ -0,0 +1,120 @@ +{ + "nodes": { + "auto-cpufreq": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736492828, + "narHash": "sha256-iDvgL5dQerQnu2ERKAWGvWppG7cQ/0uKEfVY93ItvO4=", + "owner": "AdnanHodzic", + "repo": "auto-cpufreq", + "rev": "c0d9ec565a4c78247a4f70beb1c1ae74279673e2", + "type": "github" + }, + "original": { + "owner": "AdnanHodzic", + "repo": "auto-cpufreq", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736373539, + "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "bd65bc3cde04c16755955630b344bc9e35272c56", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1736441705, + "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1736549401, + "narHash": "sha256-ibkQrMHxF/7TqAYcQE+tOnIsSEzXmMegzyBWza6uHKM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1dab772dd4a68a7bba5d9460685547ff8e17d899", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1736523798, + "narHash": "sha256-Xb8mke6UCYjge9kPR9o4P1nVrhk7QBbKv3xQ9cj7h2s=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "130595eba61081acde9001f43de3248d8888ac4a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "auto-cpufreq": "auto-cpufreq", + "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dc02f56 --- /dev/null +++ b/flake.nix @@ -0,0 +1,79 @@ +{ + description = "NixOS configuration of Julius Freudenberger"; + + inputs = { + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + home-manager = { + url = "github:nix-community/home-manager/release-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + auto-cpufreq = { + url = "github:AdnanHodzic/auto-cpufreq"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + systems.url = "github:nix-systems/default-linux"; + }; + + outputs = { + self, + nixpkgs, + nixpkgs-unstable, + nixos-hardware, + home-manager, + auto-cpufreq, + systems, + ... + } @ inputs: let + inherit (self) outputs; + lib = nixpkgs.lib; + forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system}); + pkgsFor = lib.genAttrs (import systems) ( + system: + import nixpkgs { + inherit system; + config.allowUnfree = true; + } + ); + in { + + overlays = import ./overlays {inherit inputs outputs;}; + packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;}); + + nixosConfigurations = { + julius-framework = let + username = "julius"; + in + nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + + specialArgs = { + pkgs-unstable = import nixpkgs-unstable { + inherit system; + config.allowUnfree = true; + }; + inherit inputs outputs username; + }; + + modules = [ + nixos-hardware.nixosModules.framework-11th-gen-intel + auto-cpufreq.nixosModules.default + ./hosts/julius-framework + ./users/julius/nixos.nix + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.extraSpecialArgs = inputs // specialArgs; + home-manager.users.${username} = import ./users/${username}/home.nix; + } + ]; + + }; + }; + }; +} diff --git a/home/core.nix b/home/core.nix new file mode 100644 index 0000000..1866158 --- /dev/null +++ b/home/core.nix @@ -0,0 +1,12 @@ +{username, ...}: { + home = { + inherit username; + homeDirectory = "/home/${username}"; + + preferXdgDirectories = true; + + stateVersion = "24.11"; + }; + + programs.home-manager.enable = true; +} diff --git a/home/direnv/default.nix b/home/direnv/default.nix new file mode 100644 index 0000000..0a5efb6 --- /dev/null +++ b/home/direnv/default.nix @@ -0,0 +1,7 @@ +{config, pkgs, ...}: { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; +} diff --git a/home/gtk/default.nix b/home/gtk/default.nix new file mode 100644 index 0000000..626ebbe --- /dev/null +++ b/home/gtk/default.nix @@ -0,0 +1,10 @@ +{config, pkgs, ...}: { + gtk = { + enable = true; + theme.name = "Adwaita-dark"; + iconTheme = { + name = "Arc"; + package = pkgs.arc-icon-theme; + }; + }; +} diff --git a/home/neovim/default.nix b/home/neovim/default.nix new file mode 100644 index 0000000..70a52ce --- /dev/null +++ b/home/neovim/default.nix @@ -0,0 +1,40 @@ +{config, pkgs, ...}: { + + programs.neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + viAlias = true; + vimdiffAlias = true; + withNodeJs = true; + coc.enable = true; + plugins = with pkgs.vimPlugins; [ + vim-gitgutter + markdown-preview-nvim + tabular + vim-markdown + vimtex + nvim-lspconfig + typst-vim + ]; + + extraConfig = '' + set number + set relativenumber + set termguicolors + set expandtab + set shiftwidth=2 + set linebreak + + :augroup numbertoggle + : autocmd! + : autocmd BufEnter,FocusGained,InsertLeave * set relativenumber + : autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber + :augroup END + + let g:vimtex_view_method = 'zathura' + let g:coc_filetype_map = {'tex': 'latex'} + ''; + }; + +} diff --git a/home/xdg/default.nix b/home/xdg/default.nix new file mode 100644 index 0000000..9412134 --- /dev/null +++ b/home/xdg/default.nix @@ -0,0 +1,17 @@ +{config, pkgs, ...}: { + xdg = { + enable = true; + mimeApps = { + enable = true; + defaultApplications = { + "application/pdf" = ["org.gnome.Evince.desktop"]; + "image/svg+xml" = ["viewnior.desktop"]; + "image/jpeg" = ["viewnior.desktop"]; + "image/png" = ["viewnior.desktop"]; + "application/yaml" = ["org.x.editor.desktop"]; + "text/plain" = ["org.x.editor.desktop"]; + }; + }; + userDirs.enable = true; + }; +} diff --git a/home/zsh/default.nix b/home/zsh/default.nix new file mode 100644 index 0000000..d1e0405 --- /dev/null +++ b/home/zsh/default.nix @@ -0,0 +1,33 @@ +{config, pkgs, pkgs-unstable, ...}: { + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + defaultKeymap = "viins"; + + shellAliases = { + Gst = "git status"; + Gco = "git checkout"; + Gd = "git diff"; + Gds = "git diff --staged"; + Gc = "git commit"; + }; + + history.size = 10000; + history.path = "$HOME/.zsh_history"; + + plugins = [ + + ]; + + initExtra = '' + setopt promptsubst + export PROMPT='%F{12}[%f%F{10}%n%f%F{12}@%f%F{white}%m%f%F{12}]%f%F{white}:%f %F{white}%~%f%F{12}>%b$(${pkgs-unstable.gitprompt-rs}/bin/gitprompt-rs)%f%F{10}%(!.#.$)%f ' + unsetopt beep + bindkey '^R' history-incremental-search-backward + ''; + + initExtraBeforeCompInit = "zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*'"; + }; +} diff --git a/hosts/julius-framework/default.nix b/hosts/julius-framework/default.nix new file mode 100644 index 0000000..33a2c9b --- /dev/null +++ b/hosts/julius-framework/default.nix @@ -0,0 +1,86 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ outputs, config, pkgs, ... }: + +{ + imports = + [ + ../../modules/nix.nix + ../../modules/system.nix + ../../modules/firmware.nix + ../../modules/laptop.nix + ../../modules/network.nix + ../../modules/locale.nix + ../../modules/boot-login.nix + ../../modules/fonts.nix + ../../modules/cli-essentials.nix + ../../modules/i3.nix + ../../modules/fingerprint.nix + ../../modules/logitech.nix + ../../modules/connectivity.nix + ../../modules/video-and-sound.nix + ../../modules/bluetooth.nix + ../../modules/desktop-essentials.nix + ../../modules/internet.nix + ../../modules/sync-clients.nix + ../../modules/office.nix + ../../modules/administration.nix + ../../modules/creativity.nix + ../../modules/security.nix + ../../modules/typesetting.nix + ../../modules/docker.nix + ../../modules/distrobox.nix + ../../modules/gui-coding.nix + ../../modules/optical-media.nix + ../../modules/flatpak.nix + ../../modules/gaming.nix + + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nixpkgs = { + overlays = [ + outputs.overlays.additions + ]; + }; + + # Bootloader. + boot = { + loader = { + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; + }; + }; + initrd = { + systemd.enable = true; + luks.devices = { + cryptlvm = { + device = "/dev/disk/by-uuid/45a8e584-409d-4627-8679-b8cdb837afc4"; + }; + }; + }; + tmp.useTmpfs = true; + }; + + networking.hostName = "julius-framework"; # Define your hostname. + + location = { + latitude = 48.740556; + longitude = 9.310833; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? + +} + diff --git a/hosts/julius-framework/hardware-configuration.nix b/hosts/julius-framework/hardware-configuration.nix new file mode 100644 index 0000000..057fe6f --- /dev/null +++ b/hosts/julius-framework/hardware-configuration.nix @@ -0,0 +1,45 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4e3c6669-42f3-4ebb-aec1-f09999739e38"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D676-1631"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/592e90f1-e42b-4059-ab03-eb834c05091d"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/0cd2bd1b-90b3-432c-82a0-5335900f3ba3"; } + ]; + + # 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.wlp170s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/administration.nix b/modules/administration.nix new file mode 100644 index 0000000..64bb782 --- /dev/null +++ b/modules/administration.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + remmina + + teleport_16 + ]; + +} diff --git a/modules/android.nix b/modules/android.nix new file mode 100644 index 0000000..2547e2f --- /dev/null +++ b/modules/android.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + android-studio-full + android-tools + android-udev + ]; + +} diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix new file mode 100644 index 0000000..22b5f4d --- /dev/null +++ b/modules/bluetooth.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + + hardware.bluetooth.enable = true; + + services.blueman.enable = true; + +} diff --git a/modules/boot-login.nix b/modules/boot-login.nix new file mode 100644 index 0000000..7ad180a --- /dev/null +++ b/modules/boot-login.nix @@ -0,0 +1,32 @@ +{ + pkgs, + ... +}: { + boot = { + initrd.systemd.enable = true; + kernelParams = ["quiet"]; + plymouth = { + enable = true; + theme = "bgrt"; + }; + }; + + services = { + xserver.displayManager = { + lightdm = { + enable = true; + greeters.gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + }; + iconTheme = { + name = "Arc"; + package = pkgs.arc-icon-theme; + }; + }; + }; + }; + }; + +} diff --git a/modules/cli-essentials.nix b/modules/cli-essentials.nix new file mode 100644 index 0000000..94255d6 --- /dev/null +++ b/modules/cli-essentials.nix @@ -0,0 +1,23 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + wget + curl + git + neofetch + bat + tealdeer + + pdfgrep + pdftk + p7zip + ]; + + programs = { + htop.enable = true; + zsh.enable = true; + }; +} diff --git a/modules/connectivity.nix b/modules/connectivity.nix new file mode 100644 index 0000000..a5e8233 --- /dev/null +++ b/modules/connectivity.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + + programs.kdeconnect = { + enable = true; + package = pkgs.valent; + }; + +} diff --git a/modules/creativity.nix b/modules/creativity.nix new file mode 100644 index 0000000..c01825b --- /dev/null +++ b/modules/creativity.nix @@ -0,0 +1,19 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + #gimp-with-plugins + inkscape-with-extensions + darktable + hugin + audacity + handbrake + musescore + obs-studio + + xcolor + ]; + +} diff --git a/modules/desktop-essentials.nix b/modules/desktop-essentials.nix new file mode 100644 index 0000000..2efb12e --- /dev/null +++ b/modules/desktop-essentials.nix @@ -0,0 +1,30 @@ +{ + pkgs, + lib, + ... +}: let + nemo-with-nextcloud-extensions = pkgs.nemo-with-extensions.override { extensions = [pkgs.nextcloud-client];}; + in { + environment.systemPackages = with pkgs; [ + sakura + alacritty + + evince + zathura + viewnior + pavucontrol + + xed-editor + mate.mate-calc + + xarchiver + mate.engrampa + nemo-with-nextcloud-extensions + ]; + + programs = { + nm-applet.enable = true; + dconf.enable = true; + }; + +} diff --git a/modules/distrobox.nix b/modules/distrobox.nix new file mode 100644 index 0000000..3c627ce --- /dev/null +++ b/modules/distrobox.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + + environment.systemPackages = with pkgs; [ + distrobox + ]; + +} diff --git a/modules/docker.nix b/modules/docker.nix new file mode 100644 index 0000000..b9f7aa1 --- /dev/null +++ b/modules/docker.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + + virtualisation.docker = { + enable = true; + }; + +} diff --git a/modules/fingerprint.nix b/modules/fingerprint.nix new file mode 100644 index 0000000..bb9e5ca --- /dev/null +++ b/modules/fingerprint.nix @@ -0,0 +1,9 @@ +{ + pkgs, + lib, + ... +}: { + services.fprintd = { + enable = true; + }; +} diff --git a/modules/firmware.nix b/modules/firmware.nix new file mode 100644 index 0000000..8b0034e --- /dev/null +++ b/modules/firmware.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + + services = { + fwupd.enable = true; + fstrim.enable = true; + }; + +} diff --git a/modules/flatpak.nix b/modules/flatpak.nix new file mode 100644 index 0000000..dbda817 --- /dev/null +++ b/modules/flatpak.nix @@ -0,0 +1,22 @@ +{ + pkgs, + lib, + ... +}: { + + services = { + flatpak.enable = true; + }; + + xdg.portal = { + enable = true; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; + config = { + common = { + default = ["gtk"]; + }; + }; + xdgOpenUsePortal = true; + }; + +} diff --git a/modules/fonts.nix b/modules/fonts.nix new file mode 100644 index 0000000..55a3e97 --- /dev/null +++ b/modules/fonts.nix @@ -0,0 +1,13 @@ +{ + pkgs, + lib, + ... +}: { + fonts.packages = with pkgs; [ + noto-fonts + font-awesome + terminus_font + dlrg-fonts + ]; + +} diff --git a/modules/gaming.nix b/modules/gaming.nix new file mode 100644 index 0000000..a6fad26 --- /dev/null +++ b/modules/gaming.nix @@ -0,0 +1,14 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + + ]; + + programs = { + steam.enable = true; + }; + +} diff --git a/modules/gui-coding.nix b/modules/gui-coding.nix new file mode 100644 index 0000000..33056ef --- /dev/null +++ b/modules/gui-coding.nix @@ -0,0 +1,17 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + jetbrains.idea-ultimate + jetbrains.pycharm-professional + jetbrains.phpstorm + + vscodium-fhs + zed-editor.fhs + + k6 + ]; + +} diff --git a/modules/i3.nix b/modules/i3.nix new file mode 100644 index 0000000..7c241f9 --- /dev/null +++ b/modules/i3.nix @@ -0,0 +1,58 @@ +{pkgs, ...}: { + # i3 related options + environment.pathsToLink = ["/libexec"]; # links /libexec from derivations to /run/current-system/sw + services.displayManager.defaultSession = "none+i3"; + services.xserver = { + enable = true; + + desktopManager = { + xterm.enable = false; + }; + + windowManager.i3 = { + enable = true; + extraPackages = with pkgs; [ + rofi # application launcher, the same as dmenu + dunst # notification daemon + i3blocks # status bar + lightlocker + xautolock # lock screen after some time + i3status # provide information to i3bar + i3-gaps # i3 with gaps + nitrogen # set wallpaper + acpi # battery information + arandr # screen layout manager + alsa-utils + dex # autostart applications + xbindkeys # bind keys to commands + xclip + xorg.xbacklight # control screen brightness + brightnessctl + numlockx + xorg.xdpyinfo # get screen information + sysstat # get system information + + scrot + i3-scrot + rofirefox + rofi-rbw + rbw + pinentry-gnome3 + xdotool + playerctl + ]; + }; + + # Configure keymap in X11 + xkb.layout = "eu"; + xkb.variant = ""; + }; + + services = { + libinput.touchpad.naturalScrolling = true; + gvfs.enable = true; # Mount, trash, and other functionalities + udisks2.enable = true; + autorandr.enable = true; + redshift.enable = true; + }; +} diff --git a/modules/internet.nix b/modules/internet.nix new file mode 100644 index 0000000..c6f0983 --- /dev/null +++ b/modules/internet.nix @@ -0,0 +1,28 @@ +{ + pkgs, + pkgs-unstable, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + transmission_4 + filezilla + + pkgs-unstable.element-desktop + ]; + + programs = { + firefox.enable = true; + thunderbird = { + enable = true; + package = pkgs.thunderbird-latest; + }; + }; + + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + +} diff --git a/modules/laptop.nix b/modules/laptop.nix new file mode 100644 index 0000000..73f9fa6 --- /dev/null +++ b/modules/laptop.nix @@ -0,0 +1,21 @@ +{ + pkgs, + lib, + ... +}: { + + boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen; + + services.logind = { + lidSwitch = "suspend-then-hibernate"; + lidSwitchDocked = "suspend-then-hibernate"; + powerKey = "ignore"; + }; + + programs.auto-cpufreq.enable = true; + services.tlp.enable = false; + services.thermald.enable = true; + + virtualisation.docker.enableOnBoot = false; + +} diff --git a/modules/locale.nix b/modules/locale.nix new file mode 100644 index 0000000..46816d8 --- /dev/null +++ b/modules/locale.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + +} diff --git a/modules/logitech.nix b/modules/logitech.nix new file mode 100644 index 0000000..37d97ad --- /dev/null +++ b/modules/logitech.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + + hardware.logitech.wireless = { + enable = true; + enableGraphical = true; + }; + +} diff --git a/modules/network.nix b/modules/network.nix new file mode 100644 index 0000000..4efdecd --- /dev/null +++ b/modules/network.nix @@ -0,0 +1,31 @@ +{ + pkgs, + lib, + ... +}: { + networking = { + networkmanager = { + enable = true; + wifi.powersave = true; + # logLevel = "INFO"; + }; + wireguard.enable = true; + firewall = { + # if packets are still dropped, they will show up in dmesg + logReversePathDrops = true; + # wireguard trips rpfilter up + extraCommands = '' + iptables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 1194 -j RETURN + ip6tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 1194 -j RETURN + iptables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 1194 -j RETURN + ip6tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 1194 -j RETURN + ''; + extraStopCommands = '' + iptables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 1194 -j RETURN || true + ip6tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 1194 -j RETURN || true + iptables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 1194 -j RETURN || true + ip6tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 1194 -j RETURN || true + ''; + }; + }; +} diff --git a/modules/nix.nix b/modules/nix.nix new file mode 100644 index 0000000..1329a34 --- /dev/null +++ b/modules/nix.nix @@ -0,0 +1,22 @@ +{ + pkgs, + lib, + ... +}: { + # do garbage collection weekly to keep disk usage low + nix = { + settings = { + experimental-features = ["nix-command" "flakes"]; + }; + + gc = { + automatic = lib.mkDefault true; + dates = lib.mkDefault "weekly"; + options = lib.mkDefault "--delete-older-than 7d"; + }; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + +} diff --git a/modules/office.nix b/modules/office.nix new file mode 100644 index 0000000..24a80b7 --- /dev/null +++ b/modules/office.nix @@ -0,0 +1,28 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + libreoffice-fresh + xournalpp + + system-config-printer + + simple-scan + #naps2 + + baobab + ]; + + + services.printing = { + enable = true; + drivers = with pkgs; [ + gutenprint + #epson-escpr + epson-escpr2 + ]; + }; + +} diff --git a/modules/optical-media.nix b/modules/optical-media.nix new file mode 100644 index 0000000..37c0e64 --- /dev/null +++ b/modules/optical-media.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + brasero + makemkv + usbimager + ]; + +} diff --git a/modules/security.nix b/modules/security.nix new file mode 100644 index 0000000..4a76109 --- /dev/null +++ b/modules/security.nix @@ -0,0 +1,28 @@ +{ + pkgs, + pkgs-unstable, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + pkgs-unstable.cryptomator + + keepassxc + ]; + + services.gnome.gnome-keyring.enable = true; + + programs = { + seahorse.enable = true; + ausweisapp = { + enable = true; + openFirewall = true; + }; + }; + + security = { + polkit.enable = true; + soteria.enable = true; + }; + +} diff --git a/modules/sync-clients.nix b/modules/sync-clients.nix new file mode 100644 index 0000000..fc31cfd --- /dev/null +++ b/modules/sync-clients.nix @@ -0,0 +1,11 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + nextcloud-client + pcloud + ]; + +} diff --git a/modules/system.nix b/modules/system.nix new file mode 100644 index 0000000..0183808 --- /dev/null +++ b/modules/system.nix @@ -0,0 +1,23 @@ +{ + pkgs, + lib, + username, + ... +}: { + # do garbage collection weekly to keep disk usage low + nix = { + settings = { + experimental-features = ["nix-command" "flakes"]; + }; + + gc = { + automatic = lib.mkDefault true; + dates = lib.mkDefault "weekly"; + options = lib.mkDefault "--delete-older-than 7d"; + }; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + +} diff --git a/modules/typesetting.nix b/modules/typesetting.nix new file mode 100644 index 0000000..61bdc7d --- /dev/null +++ b/modules/typesetting.nix @@ -0,0 +1,18 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + typst + typst-lsp + typstfmt + + texliveFull + + pandoc + + zotero + ]; + +} diff --git a/modules/video-and-sound.nix b/modules/video-and-sound.nix new file mode 100644 index 0000000..43e7c76 --- /dev/null +++ b/modules/video-and-sound.nix @@ -0,0 +1,22 @@ +{ + pkgs, + lib, + ... +}: { + environment.systemPackages = with pkgs; [ + #shotcut + ]; + + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + programs = { + droidcam.enable = true; + }; +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..7dda3b2 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,22 @@ +{inputs, ...}: { + + flake-inputs = final: _: { + inputs = + builtins.mapAttrs ( + _: flake: let + legacyPackages = (flake.legacyPackages or {}).${final.system} or {}; + packages = (flake.packages or {}).${final.system} or {}; + in + if legacyPackages != {} + then legacyPackages + else packages + ) + inputs; + }; + + additions = final: _prev: import ../pkgs final.pkgs; + + modifications = final: prev: { + }; + +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..4de1474 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,6 @@ +pkgs: rec { + rofirefox = pkgs.callPackage ./rofirefox {}; + nemo-nextcloud = pkgs.callPackage ./nemo-nextcloud {}; + dlrg-fonts = pkgs.callPackage ./dlrg-fonts {}; + i3-scrot = pkgs.callPackage ./i3-scrot {}; +} diff --git a/pkgs/dlrg-fonts/default.nix b/pkgs/dlrg-fonts/default.nix new file mode 100644 index 0000000..858864c --- /dev/null +++ b/pkgs/dlrg-fonts/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, requireFile, pkgs }: let + in + stdenv.mkDerivation rec { + name = "dlrg-fonts"; + version = "0-unstable-2019-11-19"; + src = requireFile { + name = "DLRG-Schriftart.zip"; + hash = "sha256-z+VH8rIeAsJhbqfRh57ryXj+RYU0kWbLcpIivbXA0sk="; + url = "https://dlrg.net/apps/dokumente?page=assetService&noheader=1&aid=1709&v=o&file=DLRG%20Schriftart.zip"; + }; + + unpackPhase = '' + runHook preUnpack + ${pkgs.unzip}/bin/unzip $src + + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + + install -Dm644 *.TTF -t $out/share/fonts/truetype + + runHook postInstall + ''; + + meta = with lib; { + platforms = platforms.all; + }; + } + diff --git a/pkgs/i3-scrot/default.nix b/pkgs/i3-scrot/default.nix new file mode 100644 index 0000000..14de51f --- /dev/null +++ b/pkgs/i3-scrot/default.nix @@ -0,0 +1,40 @@ +{ stdenv +, lib +, fetchFromGitLab +, bash +, scrot +, xdg-user-dirs +, libnotify +, xclip +, makeWrapper +}: let + pname = "i3-scrot"; + in + stdenv.mkDerivation rec { + name = pname; + version = "1-unstable-a6f3fa1c"; + src = fetchFromGitLab { + owner = "packages/extra"; + repo = pname; + domain = "gitlab.manjaro.org"; + rev = "a6f3fa1cb127b0ae8c08cfd1fccd55c9ac07abd4"; + sha256 = "sha256-1tbZnMLrMYV3IJa9LLve3kdZ+dxXiSyN0orgvIm1sR0="; + }; + buildInputs = [ bash scrot libnotify xclip ]; + nativeBuildInputs = [ makeWrapper ]; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp i3-scrot $out/bin/i3-scrot + chmod +x $out/bin/i3-scrot + wrapProgram $out/bin/i3-scrot \ + --prefix PATH : ${lib.makeBinPath [ bash scrot xdg-user-dirs libnotify xclip ]} + ''; + + meta = with lib; { + platforms = platforms.all; + }; + } + diff --git a/pkgs/nemo-nextcloud/default.nix b/pkgs/nemo-nextcloud/default.nix new file mode 100644 index 0000000..562b8a2 --- /dev/null +++ b/pkgs/nemo-nextcloud/default.nix @@ -0,0 +1,57 @@ +{ + symlinkJoin, + lib, + makeWrapper, + nemo, + nemo-python, + nextcloud-client, + python3, + extensions ? [ ], + useDefaultExtensions ? true, +}: + +let + selectedExtensions = + extensions + ++ lib.optionals useDefaultExtensions [ + # We keep this in sync with a default Mint installation + # Right now (only) nemo-share is missing + nemo-python + ]; + nemoPythonExtensionsDeps = lib.concatMap (x: x.nemoPythonExtensionDeps or [ ]) selectedExtensions; +in +symlinkJoin { + name = "nemo-with-extensions-${nemo.version}"; + + paths = [ nemo ] ++ selectedExtensions; + + nativeBuildInputs = [ makeWrapper ]; + + postBuild = '' + for f in $(find $out/bin/ $out/libexec/ -type l -not -path "*/.*"); do + wrapProgram "$f" \ + --set "NEMO_EXTENSION_DIR" "$out/${nemo.extensiondir}" \ + --set "NEMO_PYTHON_EXTENSION_DIR" "${nextcloud-client}/share/nemo-python/extensions" \ + --set "NEMO_PYTHON_SEARCH_PATH" "${python3.pkgs.makePythonPath nemoPythonExtensionsDeps}" + done + + # Don't populate the same nemo actions twice when having this globally installed + # https://github.com/NixOS/nixpkgs/issues/190781#issuecomment-1365601853 + rm -r $out/share/nemo/actions + + # Point to wrapped binary in all service files + for file in "share/dbus-1/services/nemo.FileManager1.service" \ + "share/dbus-1/services/nemo.service" + do + rm "$out/$file" + substitute "${nemo}/$file" "$out/$file" \ + --replace "${nemo}" "$out" + done + ''; + + meta = builtins.removeAttrs nemo.meta [ + "name" + "outputsToInstall" + "position" + ]; +} diff --git a/pkgs/rofirefox/case-sensitivity.patch b/pkgs/rofirefox/case-sensitivity.patch new file mode 100644 index 0000000..4e31584 --- /dev/null +++ b/pkgs/rofirefox/case-sensitivity.patch @@ -0,0 +1,14 @@ +diff --git a/rofirefox.sh b/rofirefox.sh +index e217a30..85068c1 100644 +--- a/rofirefox.sh ++++ b/rofirefox.sh +@@ -2,7 +2,7 @@ + + CONFIG_PATH=~/.mozilla/firefox/profiles.ini + +-choice=$(awk -F "=" '/Name/ { print $2 }' $CONFIG_PATH | sort | rofi -dmenu -p "Select a profile...") ++choice=$(awk -F "=" '/Name/ { print $2 }' $CONFIG_PATH | sort | rofi -dmenu -p "Select a profile... " -i) + if [ "$choice" != "" ]; then + firefox -P $choice & + else + diff --git a/pkgs/rofirefox/default.nix b/pkgs/rofirefox/default.nix new file mode 100644 index 0000000..2030d4f --- /dev/null +++ b/pkgs/rofirefox/default.nix @@ -0,0 +1,42 @@ +{ stdenv +, lib +, fetchFromGitHub +, bash +, gawk +, firefox +, rofi +, makeWrapper +}: let + pname = "rofirefox"; + in + stdenv.mkDerivation rec { + name = pname; + version = "cc14b76"; + src = fetchFromGitHub { + owner = "ethmtrgt"; + repo = pname; + rev = "cc14b76c4cea3263bd8c421f479089503271847b"; + sha256 = "ngtK31X9XyLKoHBfI8SOYbzyvW/LQBE9kq0wNhnxnP0="; + }; + buildInputs = [ bash gawk firefox rofi ]; + nativeBuildInputs = [ makeWrapper ]; + + dontBuild = true; + + patches = [ + ./case-sensitivity.patch + ]; + + installPhase = '' + mkdir -p $out/bin + cp rofirefox.sh $out/bin/rofirefox + chmod +x $out/bin/rofirefox + wrapProgram $out/bin/rofirefox \ + --prefix PATH : ${lib.makeBinPath [ bash gawk firefox rofi ]} + ''; + + meta = with lib; { + platforms = platforms.all; + }; + } + diff --git a/users/julius/home.nix b/users/julius/home.nix new file mode 100644 index 0000000..c11a0db --- /dev/null +++ b/users/julius/home.nix @@ -0,0 +1,14 @@ +{pkgs, username, ...}: { + + imports = [ + ../../home/core.nix + + ../../home/zsh + ../../home/neovim + ../../home/gtk + ../../home/xdg + + ../../home/direnv + ]; + +} diff --git a/users/julius/nixos.nix b/users/julius/nixos.nix new file mode 100644 index 0000000..e32da9d --- /dev/null +++ b/users/julius/nixos.nix @@ -0,0 +1,12 @@ +{ + pkgs, + lib, + config, + ... +}: { + users.users.julius = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" "docker"]; + shell = pkgs.zsh; + }; +}