diff --git a/Makefile b/Makefile index cf87c18..7690143 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,10 @@ live: .PHONY: android android: - nix-on-droid switch --flake $(flake); \ - cp ~/.termux/_font.ttf ~/.termux/font.ttf; \ + nix-on-droid switch --flake $(flake) + cp ~/.termux/_font.ttf ~/.termux/font.ttf cp ~/.termux/_colors.properties ~/.termux/colors.properties + cp ~/.bashrc ~/.bash_profile .PHONY: check check: diff --git a/android/Environment.nix b/android/Environment.nix deleted file mode 100644 index bc8ce1a..0000000 --- a/android/Environment.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ pkgs, ... }: { - variables = { - # Default text editor. - EDITOR = "nvim"; - - # App to use for man pages. - MANPAGER = "nvim +Man!"; - - # Allow unfree packages in shell. - NIXPKGS_ALLOW_UNFREE = "1"; - - # Current system architecture. - NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}"; - - # Terminal settings. - TERM = "xterm-256color"; - }; -} diff --git a/android/Package.nix b/android/Package.nix deleted file mode 100644 index 103f3e8..0000000 --- a/android/Package.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, ... }: { - list = with pkgs; [ - android-tools # Android adb tool. Can be used to connect to itself via wireless debugging. - binwalk # Can analyze files for other files inside them. - curl # CLI http client. - exiftool # Image info. - ffmpeg # Video/audio converter. - file # Get general info about a file. - gdu # TUI storage analyzer. - git # Version control system. - gnutar gzip xz # Archive and compression tools. - imagemagick # Image converter and transformation tool. - inetutils # Things like FTP. - jq # Json parser. - lsof # Find current file users. - man # App to read manuals. - gcc # C compiler. - nmap # Network analyzer. - openssh # Ssh client. - parallel # Run programs in parallel. - pv # IO progress bar. - radare2 # Hex editor. - ripgrep # Grep for file search. - rsync # File copy tool. - sqlite # Serverless file-based database engine. - tmux # Terminal multiplexor. - tree # Show directory stricture as a tree. - wget # CLI http download tool. - wireguard-tools # Tools to work with Wireguard. - yazi chafa # CLI file manager. - yt-dlp # Video downloader. - zip unzip # Zip archive/unarchive tools. - - coreutils dnsutils diffutils findutils utillinux # Common utilities. - gawk gnused gnugrep gnumake ripgrep # Common Gnu utils. - ]; -} diff --git a/android/default.nix b/android/default.nix deleted file mode 100644 index 81f102f..0000000 --- a/android/default.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ pkgs -, inputs -, const -, lib -, util -, config -, secret -, ... } @args: let - # Path where Termux stores user data. - homePath = "/data/data/com.termux.nix/files/home"; - - # Android modules. - environment = import ./Environment.nix args; - git = import ./Git.nix args; - package = import ./Package.nix args; - termux = import ./Termux.nix args; - - # External modules. - bash = import ../module/common/bash args; - nvim = import ../module/common/nvim args; - ssh = import ../module/common/ssh args; - stylix = import ../module/common/Stylix.nix args; - tmux = import ../module/common/tmux args; - yazi = import ../user/common/yazi args; -in { - # Configure system. - time.timeZone = const.timeZone; - nix.extraOptions = "experimental-features = nix-command flakes"; - - # Install packages. - environment.packages = package.list; - - # Home manager config. - home-manager.config = stylix // { - imports = [ - inputs.stylix.homeManagerModules.stylix - ]; - - home = { - # Release version. - stateVersion = const.droidStateVersion; - - # Environment variables. - sessionVariables = environment.variables; - - # Where to put config files. - file = { - ".dotfiles".source = inputs.self; - ".ssh/config".text = ssh.config; - ".termux/_font.ttf".source = termux.font; - ".termux/_colors.properties".text = termux.colors; - ".config/yazi/init.lua".source = yazi.init; - ".config/yazi/keymap.toml".source = yazi.keymap; - ".config/yazi/theme.toml".source = yazi.theme; - ".config/yazi/yazi.toml".source = yazi.yazi; - }; - }; - - # Special app configuration. - programs = { - home-manager.enable = true; - - bash = { - enable = true; - bashrcExtra = bash.config + termux.initScript; - }; - - tmux = { - enable = true; - extraConfig = tmux.config; - }; - - git = { - enable = true; - extraConfig = git.config; - }; - - neovim = { - enable = true; - extraConfig = nvim.config; - }; - - gpg = { - enable = true; - inherit (secret.crypto) publicKeys; - }; - }; - }; -} diff --git a/module/common/Setting.nix b/config/Setting.nix similarity index 100% rename from module/common/Setting.nix rename to config/Setting.nix diff --git a/module/common/Style.nix b/config/Style.nix similarity index 100% rename from module/common/Style.nix rename to config/Style.nix diff --git a/module/common/Stylix.nix b/config/Stylix.nix similarity index 80% rename from module/common/Stylix.nix rename to config/Stylix.nix index 6aca0b1..2015b9d 100644 --- a/module/common/Stylix.nix +++ b/config/Stylix.nix @@ -1,7 +1,7 @@ -{ pkgs, config, ... }: { +{ pkgs, config, __findFile, ... }: { stylix = { enable = true; - image = config.module.common.wallpaper.path; + image = config.module.wallpaper.path; autoEnable = true; polarity = "dark"; opacity = { @@ -17,7 +17,7 @@ }; fonts = let serif = { - package = (pkgs.callPackage ./applefont {}); + package = (pkgs.callPackage {}); name = "SF Pro Display"; }; in { @@ -38,7 +38,7 @@ name = "Noto Color Emoji"; }; }; - override = if config.module.common.wallpaper.forceContrastText then { + override = if config.module.wallpaper.forceContrastText then { base04 = "000000"; base05 = "ffffff"; base06 = "ffffff"; diff --git a/module/common/Wallpaper.nix b/config/Wallpaper.nix similarity index 93% rename from module/common/Wallpaper.nix rename to config/Wallpaper.nix index a59b55c..cdeeb09 100644 --- a/module/common/Wallpaper.nix +++ b/config/Wallpaper.nix @@ -4,7 +4,7 @@ forceContrastText = false; in { options = { - module.common.wallpaper = { + module.wallpaper = { forceContrastText = mkOption { default = forceContrastText; type = types.bool; diff --git a/flake.nix b/flake.nix index a3ba52f..40ab3e8 100644 --- a/flake.nix +++ b/flake.nix @@ -137,14 +137,18 @@ url = "https://git.voronind.com/voronind/nixos.git"; }; - nixosConfigurations = let - # List all files in a dir. - lsFiles = path: map (f: "${path}/${f}") ( - builtins.filter (i: builtins.readFileType "${path}/${i}" == "regular") ( - builtins.attrNames (builtins.readDir path) - ) - ); + # Hack to use in other files. + # Need to add __findFile to args tho. + __findFile = _: p: ./${p}; + # List all files in a dir. + lsFiles = path: map (f: "${path}/${f}") ( + builtins.filter (i: builtins.readFileType "${path}/${i}" == "regular") ( + builtins.attrNames (builtins.readDir path) + ) + ); + + nixosConfigurations = let # Function to create a host. It does basic setup, like adding common modules. mkHost = { system, hostname, modules } @args: nixpkgs.lib.nixosSystem { # `Inherit` is just an alias for `system = system;`, which means that @@ -164,12 +168,11 @@ # Add modules. { imports = - (lsFiles ./container) ++ - (lsFiles ./module) ++ - (lsFiles ./module/common) ++ - (lsFiles ./module/desktop) ++ - (lsFiles ./overlay) ++ - (lsFiles ./user); + (self.lsFiles ./config) ++ + (self.lsFiles ./container) ++ + (self.lsFiles ./module) ++ + (self.lsFiles ./overlay) ++ + [ ./home/NixOs.nix ]; } # Add Home Manager module. @@ -184,23 +187,20 @@ pkgs = nixpkgs.legacyPackages.${system}.pkgs; lib = nixpkgs.lib; config = self.nixosConfigurations.${hostname}.config; + in { + inherit inputs self; + inherit (self) const __findFile; pkgsJobber = nixpkgsJobber.legacyPackages.${system}.pkgs; - pkgsStable = nixpkgsJobber.legacyPackages.${system}.pkgs; - pkgsMaster = nixpkgsJobber.legacyPackages.${system}.pkgs; + pkgsStable = nixpkgsStable.legacyPackages.${system}.pkgs; + pkgsMaster = nixpkgsMaster.legacyPackages.${system}.pkgs; secret = import ./secret {}; # Secrets (public keys). container = import ./lib/Container.nix { inherit lib pkgs config; inherit (self) const; }; # Container utils. util = import ./lib/Util.nix { inherit lib; }; # Util functions. - in { - inherit secret container util inputs; - inherit (self) const; - - # Stable and Master pkgs. - inherit pkgsStable pkgsMaster; # Stuff for Jobber container, skip this part. - inherit poetry2nixJobber pkgsJobber; + inherit poetry2nixJobber; }; }; @@ -221,10 +221,10 @@ { services.openssh.settings.PermitRootLogin = nixpkgs.lib.mkForce "yes"; } # Disable auto-updates as they are not possible for Live ISO. - { module.common.autoupdate.enable = false; } + { module.autoupdate.enable = false; } # Base Live images also require the LTS kernel. - { module.common.kernel.latest = false; } + { module.kernel.latest = false; } ]; x86System = hostname: mkSystem hostname "x86_64-linux" []; @@ -245,6 +245,58 @@ (x86LiveSystem "live") ]; + + # Home manager (distro-independent). + # Install nix: sh <(curl -L https://nixos.org/nix/install) --no-daemon + # Or with --daemon for multi-user (as root). + # $ nix run home-manager/master -- init --switch + # $ nix shell '' -A install + # Add to /etc/nix/nix.conf > experimental-features = nix-command flakes + # And then # systemctl restart nix-daemon.service + # $ home-manager switch --flake ~/hmconf + homeConfigurations = let + lib = nixpkgs.lib; + secret = import ./secret {}; + util = import ./lib/Util.nix { inherit lib; }; + + mkCommonHome = username: homeDirectory: system: modules: let + pkgs = nixpkgs.legacyPackages.${system}; + pkgsStable = nixpkgsStable.legacyPackages.${system}; + pkgsMaster = nixpkgsMaster.legacyPackages.${system}; + in { + ${username} = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + extraSpecialArgs = { + inherit self inputs secret util pkgs pkgsStable pkgsMaster; + inherit (self) const __findFile; + }; + modules = modules ++ (self.lsFiles ./config) ++ [ + ./home/HomeManager.nix + { home.hm.enable = true; } + { home.hm.username = username; } + { home.hm.homeDirectory = homeDirectory; } + { home.hm.packages.core.enable = true; } + + { nixpkgs.config.allowUnfree = true; } + { nixpkgs.config.allowUnfreePredicate = (pkg: true); } + { nix.package = pkgs.nix; } + { nix.settings.experimental-features = [ "nix-command " "flakes" ]; } + + inputs.stylix.homeManagerModules.stylix + ]; + }; + }; + + x86LinuxHome = username: modules: mkCommonHome username "/home/${username}" "x86_64-linux" modules; + x86LinuxRoot = mkCommonHome "root" "/root" "x86_64-linux" []; + in nixpkgs.lib.foldl' (acc: h: acc // h) {} [ + x86LinuxRoot + (x86LinuxHome "voronind" [ + { home.hm.packages.common.enable = true; } + ]) + ]; + # Android. nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { modules = let @@ -255,12 +307,18 @@ { system.stateVersion = self.const.droidStateVersion; } # I put all my Android configuration there. - ./android + ./home/Android.nix + { home.android.enable = true; } + + # { nixpkgs.config.allowUnfree = true; } + # { nixpkgs.config.allowUnfreePredicate = (pkg: true); } + { nix.extraOptions = "experimental-features = nix-command flakes"; } + { home-manager.config.stylix.autoEnable = lib.mkForce false; } # Some common modules. - ./module/common/Setting.nix - ./module/common/Wallpaper.nix - (import ./module/common/Style.nix { inherit lib; inherit (config.home-manager) config; }) + ./config/Setting.nix + ./config/Wallpaper.nix + (import ./config/Style.nix { inherit lib; inherit (config.home-manager) config; }) ]; # SpecialArgs allows you to pass objects down to other configuration. @@ -269,11 +327,11 @@ pkgs = nixpkgs.legacyPackages."aarch64-linux".pkgs; lib = nixpkgs.lib; in { - inherit inputs; - inherit (self) const; + inherit inputs self; + inherit (self) const __findFile; - secret = import ./secret {}; # Secrets (public keys). - util = import ./lib/Util.nix { inherit lib; }; # Util functions. + secret = import ./secret {}; # Secrets (public keys). + util = import ./lib/Util.nix { inherit lib; }; # Util functions. }; }; }; diff --git a/home/Android.nix b/home/Android.nix new file mode 100644 index 0000000..e1e1123 --- /dev/null +++ b/home/Android.nix @@ -0,0 +1,40 @@ +# This is a common user configuration. +{ const +, pkgs +, self +, config +, lib +, inputs +, pkgsStable +, pkgsMaster +, __findFile +, ... } @args: with lib; let + cfg = config.home.android; + stylix = import args; + android = import ./android args; + package = import args; + # homePath = "/data/data/com.termux.nix/files/home"; +in { + options = { + home.android = { + enable = mkEnableOption "Android HM config."; + }; + }; + + config = mkIf cfg.enable { + time.timeZone = const.timeZone; + environment.packages = package.core; + home-manager.config = stylix // { + imports = [ inputs.stylix.homeManagerModules.stylix ]; + home = { + stateVersion = const.droidStateVersion; + sessionVariables = import ./variable args; + file = (import ./config args) // { + ".termux/_font.ttf".source = android.font; + ".termux/_colors.properties".text = android.colors; + }; + }; + programs = import ./program args; + }; + }; +} diff --git a/home/HomeManager.nix b/home/HomeManager.nix new file mode 100644 index 0000000..f196660 --- /dev/null +++ b/home/HomeManager.nix @@ -0,0 +1,59 @@ +# This is a common user configuration. +{ const +, util +, config +, lib +, __findFile +, ... } @args: with lib; let + cfg = config.home.hm; + package = import args; +in { + options = { + home.hm = { + enable = mkEnableOption "Home-Manager standalone config."; + username = mkOption { + default = null; + type = types.str; + }; + homeDirectory = mkOption { + default = "/home/${cfg.username}"; + type = types.str; + }; + packages = mkOption { + default = {}; + type = types.submodule { + options = { + core.enable = mkEnableOption "Core apps."; + common.enable = mkEnableOption "Common apps."; + desktop.enable = mkEnableOption "Desktop apps."; + gaming.enable = mkEnableOption "Gaming apps."; + creative.enable = mkEnableOption "Creative apps."; + dev.enable = mkEnableOption "Dev apps."; + extra.enable = mkEnableOption "Extra apps."; + }; + }; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + { + home = { + inherit (cfg) username homeDirectory; + inherit (const) stateVersion; + file = import ./config args; + sessionVariables = import ./variable args; + }; + xdg = import ./xdg { inherit (cfg) homeDirectory; }; + programs = import ./program args; + dconf.settings = util.catSet (util.ls ./config/dconf) args; + } + (mkIf cfg.packages.core.enable { home.packages = package.core; }) + (mkIf cfg.packages.common.enable { home.packages = package.common; }) + (mkIf cfg.packages.desktop.enable { home.packages = package.desktop; }) + (mkIf cfg.packages.gaming.enable { home.packages = package.gaming; }) + (mkIf cfg.packages.creative.enable { home.packages = package.creative; }) + (mkIf cfg.packages.dev.enable { home.packages = package.dev; }) + (mkIf cfg.packages.extra.enable { home.packages = package.extra; }) + ]); +} diff --git a/home/NixOs.nix b/home/NixOs.nix new file mode 100644 index 0000000..13d5eae --- /dev/null +++ b/home/NixOs.nix @@ -0,0 +1,41 @@ +# This is a common user configuration. +{ const +, config +, util +, lib +, pkgs +, ... } @args: with lib; let + cfg = config.home.nixos; +in { + imports = (util.ls ./user); + + options = { + home.nixos = { + enable = mkEnableOption "NixOS user setup."; + users = mkOption { + default = []; + type = types.listOf types.attrs; + }; + }; + }; + + config = mkIf cfg.enable { + home-manager = { + users = builtins.foldl' (acc: user: acc // { + ${user.username} = { + home = { + inherit (const) stateVersion; + inherit (user) username homeDirectory; + file = import ./config args; + sessionVariables = import ./variable args; + }; + xdg = import ./xdg { inherit (user) homeDirectory; }; + programs = import ./program args; + dconf.settings = util.catSet (util.ls ./config/dconf) args; + }; + }) {} cfg.users; + + backupFileExtension = "old"; + }; + }; +} diff --git a/android/Termux.nix b/home/android/default.nix similarity index 52% rename from android/Termux.nix rename to home/android/default.nix index df445c4..1950353 100644 --- a/android/Termux.nix +++ b/home/android/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, util, ... }: { +{ pkgs, util, config, ... }: { font = pkgs.runCommandNoCC "font" {} '' cp ${pkgs.nerdfonts.override { fonts = [ "Terminus" ]; }}/share/fonts/truetype/NerdFonts/TerminessNerdFontMono-Regular.ttf $out ''; @@ -7,12 +7,4 @@ background=#${config.style.color.bg.dark} foreground=#${config.style.color.fg.light} ''; - - initScript = util.trimTabs '' - [[ -f ~/.termux/font.ttf ]] || { - cp ~/.termux/_font.ttf ~/.termux/font.ttf - cp ~/.termux/_colors.properties ~/.termux/colors.properties - _warn "Termux config installed, please restart." - }; - ''; } diff --git a/home/config/bash/default.nix b/home/config/bash/default.nix new file mode 100644 index 0000000..6373b5c --- /dev/null +++ b/home/config/bash/default.nix @@ -0,0 +1,38 @@ +{ util, pkgs, ... } @args: let + modules = util.catText (util.ls ./module) args; + modulesFile = pkgs.writeText "BashModules" modules; +in { + inherit modules modulesFile; + + bashrc = modules + util.trimTabs '' + # Find all functions. + function find_function() { + /usr/bin/env cat ${modulesFile} | /usr/bin/env grep "^function.*()" | /usr/bin/env sed -e "s/^function //" -e "s/().*//" + } + + # Export all functions. + export -f $(find_function | tr '\n' ' ') + export -f find_function + + # Autostart Sway. + if [[ -z $DISPLAY ]] && [[ "$(tty)" = "/dev/tty1" ]]; then + exec sway + fi + ''; + + bash_profile = util.trimTabs '' + # Home manager. + [ -e ~/.nix-profile/etc/profile.d/nix.sh ] && source ~/.nix-profile/etc/profile.d/nix.sh + + # Bashrc. + [ -f ~/.bashrc ] && source ~/.bashrc + + # Profile. + [ -f ~/.profile ] && source ~/.profile + ''; + + profile = util.trimTabs '' + # Load HM vars. + [ -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ] && source ~/.nix-profile/etc/profile.d/hm-session-vars.sh + ''; +} diff --git a/module/common/bash/module/Android.nix b/home/config/bash/module/Android.nix similarity index 100% rename from module/common/bash/module/Android.nix rename to home/config/bash/module/Android.nix diff --git a/module/common/bash/module/Archive.nix b/home/config/bash/module/Archive.nix similarity index 98% rename from module/common/bash/module/Archive.nix rename to home/config/bash/module/Archive.nix index cdf996e..65e3a4c 100644 --- a/module/common/bash/module/Archive.nix +++ b/home/config/bash/module/Archive.nix @@ -21,7 +21,7 @@ }; # Cut full paths. - target="''${target##*/}" + [[ "''${target##*/}" = "" ]] || target="''${target##*/}" local date=$(_archive_date) @@ -62,7 +62,7 @@ }; # Cut full paths. - target="''${target##*/}" + [[ "''${target##*/}" = "" ]] || target="''${target##*/}" # Start timestamp. local date=$(_archive_date) diff --git a/module/common/bash/module/Ask.nix b/home/config/bash/module/Ask.nix similarity index 100% rename from module/common/bash/module/Ask.nix rename to home/config/bash/module/Ask.nix diff --git a/module/common/bash/module/Autocomplete.nix b/home/config/bash/module/Autocomplete.nix similarity index 100% rename from module/common/bash/module/Autocomplete.nix rename to home/config/bash/module/Autocomplete.nix diff --git a/module/common/bash/module/Battery.nix b/home/config/bash/module/Battery.nix similarity index 100% rename from module/common/bash/module/Battery.nix rename to home/config/bash/module/Battery.nix diff --git a/module/common/bash/module/Bootstrap.nix b/home/config/bash/module/Bootstrap.nix similarity index 100% rename from module/common/bash/module/Bootstrap.nix rename to home/config/bash/module/Bootstrap.nix diff --git a/module/common/bash/module/Brightness.nix b/home/config/bash/module/Brightness.nix similarity index 100% rename from module/common/bash/module/Brightness.nix rename to home/config/bash/module/Brightness.nix diff --git a/module/common/bash/module/Calc.nix b/home/config/bash/module/Calc.nix similarity index 100% rename from module/common/bash/module/Calc.nix rename to home/config/bash/module/Calc.nix diff --git a/module/common/bash/module/Cd.nix b/home/config/bash/module/Cd.nix similarity index 100% rename from module/common/bash/module/Cd.nix rename to home/config/bash/module/Cd.nix diff --git a/module/common/bash/module/Checksum.nix b/home/config/bash/module/Checksum.nix similarity index 100% rename from module/common/bash/module/Checksum.nix rename to home/config/bash/module/Checksum.nix diff --git a/module/common/bash/module/Chmod.nix b/home/config/bash/module/Chmod.nix similarity index 100% rename from module/common/bash/module/Chmod.nix rename to home/config/bash/module/Chmod.nix diff --git a/module/common/bash/module/Color.nix b/home/config/bash/module/Color.nix similarity index 100% rename from module/common/bash/module/Color.nix rename to home/config/bash/module/Color.nix diff --git a/module/common/bash/module/Container.nix b/home/config/bash/module/Container.nix similarity index 100% rename from module/common/bash/module/Container.nix rename to home/config/bash/module/Container.nix diff --git a/module/common/bash/module/Copypaste.nix b/home/config/bash/module/Copypaste.nix similarity index 100% rename from module/common/bash/module/Copypaste.nix rename to home/config/bash/module/Copypaste.nix diff --git a/module/common/bash/module/Cp.nix b/home/config/bash/module/Cp.nix similarity index 100% rename from module/common/bash/module/Cp.nix rename to home/config/bash/module/Cp.nix diff --git a/module/common/bash/module/Date.nix b/home/config/bash/module/Date.nix similarity index 100% rename from module/common/bash/module/Date.nix rename to home/config/bash/module/Date.nix diff --git a/module/common/bash/module/Dconf.nix b/home/config/bash/module/Dconf.nix similarity index 100% rename from module/common/bash/module/Dconf.nix rename to home/config/bash/module/Dconf.nix diff --git a/module/common/bash/module/Disk.nix b/home/config/bash/module/Disk.nix similarity index 100% rename from module/common/bash/module/Disk.nix rename to home/config/bash/module/Disk.nix diff --git a/module/common/bash/module/Distrobox.nix b/home/config/bash/module/Distrobox.nix similarity index 100% rename from module/common/bash/module/Distrobox.nix rename to home/config/bash/module/Distrobox.nix diff --git a/module/common/bash/module/Dmenu.nix b/home/config/bash/module/Dmenu.nix similarity index 100% rename from module/common/bash/module/Dmenu.nix rename to home/config/bash/module/Dmenu.nix diff --git a/module/common/bash/module/Docker.nix b/home/config/bash/module/Docker.nix similarity index 100% rename from module/common/bash/module/Docker.nix rename to home/config/bash/module/Docker.nix diff --git a/module/common/bash/module/Dvd.nix b/home/config/bash/module/Dvd.nix similarity index 100% rename from module/common/bash/module/Dvd.nix rename to home/config/bash/module/Dvd.nix diff --git a/module/common/bash/module/Ffmpeg.nix b/home/config/bash/module/Ffmpeg.nix similarity index 100% rename from module/common/bash/module/Ffmpeg.nix rename to home/config/bash/module/Ffmpeg.nix diff --git a/module/common/bash/module/File.nix b/home/config/bash/module/File.nix similarity index 100% rename from module/common/bash/module/File.nix rename to home/config/bash/module/File.nix diff --git a/module/common/bash/module/Find.nix b/home/config/bash/module/Find.nix similarity index 100% rename from module/common/bash/module/Find.nix rename to home/config/bash/module/Find.nix diff --git a/module/common/bash/module/Fix.nix b/home/config/bash/module/Fix.nix similarity index 100% rename from module/common/bash/module/Fix.nix rename to home/config/bash/module/Fix.nix diff --git a/module/common/bash/module/Git.nix b/home/config/bash/module/Git.nix similarity index 100% rename from module/common/bash/module/Git.nix rename to home/config/bash/module/Git.nix diff --git a/module/common/bash/module/Gpg.nix b/home/config/bash/module/Gpg.nix similarity index 100% rename from module/common/bash/module/Gpg.nix rename to home/config/bash/module/Gpg.nix diff --git a/module/common/bash/module/Group.nix b/home/config/bash/module/Group.nix similarity index 100% rename from module/common/bash/module/Group.nix rename to home/config/bash/module/Group.nix diff --git a/module/common/bash/module/Help.nix b/home/config/bash/module/Help.nix similarity index 100% rename from module/common/bash/module/Help.nix rename to home/config/bash/module/Help.nix diff --git a/module/common/bash/module/Ls.nix b/home/config/bash/module/Ls.nix similarity index 100% rename from module/common/bash/module/Ls.nix rename to home/config/bash/module/Ls.nix diff --git a/module/common/bash/module/Markdown.nix b/home/config/bash/module/Markdown.nix similarity index 100% rename from module/common/bash/module/Markdown.nix rename to home/config/bash/module/Markdown.nix diff --git a/module/common/bash/module/Name.nix b/home/config/bash/module/Name.nix similarity index 100% rename from module/common/bash/module/Name.nix rename to home/config/bash/module/Name.nix diff --git a/module/common/bash/module/Network.nix b/home/config/bash/module/Network.nix similarity index 100% rename from module/common/bash/module/Network.nix rename to home/config/bash/module/Network.nix diff --git a/module/common/bash/module/Nix.nix b/home/config/bash/module/Nix.nix similarity index 100% rename from module/common/bash/module/Nix.nix rename to home/config/bash/module/Nix.nix diff --git a/module/common/bash/module/Notify.nix b/home/config/bash/module/Notify.nix similarity index 100% rename from module/common/bash/module/Notify.nix rename to home/config/bash/module/Notify.nix diff --git a/module/common/bash/module/Own.nix b/home/config/bash/module/Own.nix similarity index 100% rename from module/common/bash/module/Own.nix rename to home/config/bash/module/Own.nix diff --git a/module/common/bash/module/Pack.nix b/home/config/bash/module/Pack.nix similarity index 100% rename from module/common/bash/module/Pack.nix rename to home/config/bash/module/Pack.nix diff --git a/module/common/bash/module/Parse.nix b/home/config/bash/module/Parse.nix similarity index 100% rename from module/common/bash/module/Parse.nix rename to home/config/bash/module/Parse.nix diff --git a/module/common/bash/module/Permission.nix b/home/config/bash/module/Permission.nix similarity index 100% rename from module/common/bash/module/Permission.nix rename to home/config/bash/module/Permission.nix diff --git a/module/common/bash/module/Power.nix b/home/config/bash/module/Power.nix similarity index 100% rename from module/common/bash/module/Power.nix rename to home/config/bash/module/Power.nix diff --git a/module/common/bash/module/Prune.nix b/home/config/bash/module/Prune.nix similarity index 100% rename from module/common/bash/module/Prune.nix rename to home/config/bash/module/Prune.nix diff --git a/module/common/bash/module/Ps.nix b/home/config/bash/module/Ps.nix similarity index 100% rename from module/common/bash/module/Ps.nix rename to home/config/bash/module/Ps.nix diff --git a/module/common/bash/module/Ps1.nix b/home/config/bash/module/Ps1.nix similarity index 100% rename from module/common/bash/module/Ps1.nix rename to home/config/bash/module/Ps1.nix diff --git a/module/common/bash/module/Random.nix b/home/config/bash/module/Random.nix similarity index 100% rename from module/common/bash/module/Random.nix rename to home/config/bash/module/Random.nix diff --git a/module/common/bash/module/Recursive.nix b/home/config/bash/module/Recursive.nix similarity index 100% rename from module/common/bash/module/Recursive.nix rename to home/config/bash/module/Recursive.nix diff --git a/module/common/bash/module/Save.nix b/home/config/bash/module/Save.nix similarity index 100% rename from module/common/bash/module/Save.nix rename to home/config/bash/module/Save.nix diff --git a/module/common/bash/module/Shopt.nix b/home/config/bash/module/Shopt.nix similarity index 100% rename from module/common/bash/module/Shopt.nix rename to home/config/bash/module/Shopt.nix diff --git a/module/common/bash/module/Ssh.nix b/home/config/bash/module/Ssh.nix similarity index 100% rename from module/common/bash/module/Ssh.nix rename to home/config/bash/module/Ssh.nix diff --git a/module/common/bash/module/Steam.nix b/home/config/bash/module/Steam.nix similarity index 100% rename from module/common/bash/module/Steam.nix rename to home/config/bash/module/Steam.nix diff --git a/module/common/bash/module/Su.nix b/home/config/bash/module/Su.nix similarity index 100% rename from module/common/bash/module/Su.nix rename to home/config/bash/module/Su.nix diff --git a/module/common/bash/module/Terminal.nix b/home/config/bash/module/Terminal.nix similarity index 100% rename from module/common/bash/module/Terminal.nix rename to home/config/bash/module/Terminal.nix diff --git a/module/common/bash/module/Tmp.nix b/home/config/bash/module/Tmp.nix similarity index 100% rename from module/common/bash/module/Tmp.nix rename to home/config/bash/module/Tmp.nix diff --git a/module/common/bash/module/Tmux.nix b/home/config/bash/module/Tmux.nix similarity index 100% rename from module/common/bash/module/Tmux.nix rename to home/config/bash/module/Tmux.nix diff --git a/module/common/bash/module/Todo.nix b/home/config/bash/module/Todo.nix similarity index 100% rename from module/common/bash/module/Todo.nix rename to home/config/bash/module/Todo.nix diff --git a/module/common/bash/module/Transcode.nix b/home/config/bash/module/Transcode.nix similarity index 100% rename from module/common/bash/module/Transcode.nix rename to home/config/bash/module/Transcode.nix diff --git a/module/common/bash/module/Try.nix b/home/config/bash/module/Try.nix similarity index 100% rename from module/common/bash/module/Try.nix rename to home/config/bash/module/Try.nix diff --git a/module/common/bash/module/Util.nix b/home/config/bash/module/Util.nix similarity index 100% rename from module/common/bash/module/Util.nix rename to home/config/bash/module/Util.nix diff --git a/module/common/bash/module/Vdl.nix b/home/config/bash/module/Vdl.nix similarity index 100% rename from module/common/bash/module/Vdl.nix rename to home/config/bash/module/Vdl.nix diff --git a/module/common/bash/module/Vi.nix b/home/config/bash/module/Vi.nix similarity index 100% rename from module/common/bash/module/Vi.nix rename to home/config/bash/module/Vi.nix diff --git a/module/common/bash/module/Watch.nix b/home/config/bash/module/Watch.nix similarity index 100% rename from module/common/bash/module/Watch.nix rename to home/config/bash/module/Watch.nix diff --git a/module/desktop/dconf/Accessibility.nix b/home/config/dconf/Accessibility.nix similarity index 100% rename from module/desktop/dconf/Accessibility.nix rename to home/config/dconf/Accessibility.nix diff --git a/module/desktop/dconf/Gtk.nix b/home/config/dconf/Gtk.nix similarity index 100% rename from module/desktop/dconf/Gtk.nix rename to home/config/dconf/Gtk.nix diff --git a/module/desktop/dconf/Input.nix b/home/config/dconf/Input.nix similarity index 100% rename from module/desktop/dconf/Input.nix rename to home/config/dconf/Input.nix diff --git a/module/desktop/dconf/Interface.nix b/home/config/dconf/Interface.nix similarity index 100% rename from module/desktop/dconf/Interface.nix rename to home/config/dconf/Interface.nix diff --git a/module/desktop/dconf/Key.nix b/home/config/dconf/Key.nix similarity index 100% rename from module/desktop/dconf/Key.nix rename to home/config/dconf/Key.nix diff --git a/module/desktop/dconf/Media.nix b/home/config/dconf/Media.nix similarity index 100% rename from module/desktop/dconf/Media.nix rename to home/config/dconf/Media.nix diff --git a/module/desktop/dconf/Nautilus.nix b/home/config/dconf/Nautilus.nix similarity index 100% rename from module/desktop/dconf/Nautilus.nix rename to home/config/dconf/Nautilus.nix diff --git a/module/desktop/dconf/Power.nix b/home/config/dconf/Power.nix similarity index 100% rename from module/desktop/dconf/Power.nix rename to home/config/dconf/Power.nix diff --git a/module/desktop/dconf/Privacy.nix b/home/config/dconf/Privacy.nix similarity index 100% rename from module/desktop/dconf/Privacy.nix rename to home/config/dconf/Privacy.nix diff --git a/module/desktop/dconf/Session.nix b/home/config/dconf/Session.nix similarity index 100% rename from module/desktop/dconf/Session.nix rename to home/config/dconf/Session.nix diff --git a/module/desktop/dconf/Shell.nix b/home/config/dconf/Shell.nix similarity index 100% rename from module/desktop/dconf/Shell.nix rename to home/config/dconf/Shell.nix diff --git a/module/desktop/dconf/Software.nix b/home/config/dconf/Software.nix similarity index 100% rename from module/desktop/dconf/Software.nix rename to home/config/dconf/Software.nix diff --git a/module/desktop/dconf/Sound.nix b/home/config/dconf/Sound.nix similarity index 100% rename from module/desktop/dconf/Sound.nix rename to home/config/dconf/Sound.nix diff --git a/module/desktop/dconf/Wm.nix b/home/config/dconf/Wm.nix similarity index 100% rename from module/desktop/dconf/Wm.nix rename to home/config/dconf/Wm.nix diff --git a/home/config/default.nix b/home/config/default.nix new file mode 100644 index 0000000..414c04b --- /dev/null +++ b/home/config/default.nix @@ -0,0 +1,48 @@ +{ self, config, ... } @args: let + bash = import ./bash args; + btop = import ./top/btop args; + editor = import ./editorconfig args; + foot = import ./foot args; + fuzzel = import ./fuzzel args; + git = import ./git args; + gtk3 = import ./gtk/3 args; + htop = import ./top/htop args; + keyd = import ./keyd args; + mako = import ./mako args; + mangohud = import ./mangohud args; + nvim = import ./nvim args; + ssh = import ./ssh args; + sway = import ./sway args; + tmux = import ./tmux args; + waybar = import ./waybar args; + yazi = import ./yazi args; +in { + ".bashrc".text = bash.bashrc; + ".bash_profile".text = bash.bash_profile; + ".profile".text = bash.profile; + ".config/MangoHud/MangoHud.conf".text = mangohud.config; + ".config/MangoHud/presets.conf".text = mangohud.presets; + ".config/btop/btop.conf".text = btop.text; + ".config/foot/foot.ini".source = foot.file; + ".config/fuzzel/fuzzel.ini".source = fuzzel.file; + ".config/gtk-3.0/bookmarks".text = gtk3.bookmarks; + ".config/htop/htoprc".text = htop.text; + ".config/keyd/app.conf".text = keyd.text; + ".config/mako/config".source = mako.file; + ".config/nvim/init.vim".text = nvim.text; + ".config/sway/config".text = sway.text; + ".config/tmux/tmux.conf".text = tmux.text; + ".config/waybar/config".source = waybar.config; + ".config/waybar/style.css".source = waybar.style; + ".config/yazi/init.lua".source = yazi.init; + ".config/yazi/keymap.toml".source = yazi.keymap; + ".config/yazi/theme.toml".source = yazi.theme; + ".config/yazi/yazi.toml".source = yazi.yazi; + ".editorconfig".source = editor.file; + ".gitconfig".source = git.file; + ".nixos".source = self; + ".parallel/will-cite".text = ""; + ".ssh/config".text = ssh.text; + ".wallpaper".source = config.module.wallpaper.path; + "media/template".source = ./template; +} diff --git a/user/common/editorconfig/default.nix b/home/config/editorconfig/default.nix similarity index 100% rename from user/common/editorconfig/default.nix rename to home/config/editorconfig/default.nix diff --git a/user/common/foot/default.nix b/home/config/foot/default.nix similarity index 100% rename from user/common/foot/default.nix rename to home/config/foot/default.nix diff --git a/user/common/fuzzel/default.nix b/home/config/fuzzel/default.nix similarity index 100% rename from user/common/fuzzel/default.nix rename to home/config/fuzzel/default.nix diff --git a/android/Git.nix b/home/config/git/default.nix similarity index 73% rename from android/Git.nix rename to home/config/git/default.nix index c987807..47aab78 100644 --- a/android/Git.nix +++ b/home/config/git/default.nix @@ -1,5 +1,5 @@ -{ secret, ... }: { - config = { +{ secret, pkgs, ... }: { + file = (pkgs.formats.gitIni { listsAsDuplicateKeys = true; }).generate "GitConfig" { credential.helper = "store"; gpg.format = secret.crypto.sign.git.format; gpg.ssh.allowedSignersFile = toString secret.crypto.sign.git.allowed; @@ -7,6 +7,7 @@ pull.rebase = true; push.autoSetupRemote = true; rebase.autoStash = true; + safe.directory = "*"; user.signingkey = builtins.readFile secret.crypto.sign.git.key; }; } diff --git a/user/common/gtk/3/default.nix b/home/config/gtk/3/default.nix similarity index 100% rename from user/common/gtk/3/default.nix rename to home/config/gtk/3/default.nix diff --git a/user/common/keyd/default.nix b/home/config/keyd/default.nix similarity index 100% rename from user/common/keyd/default.nix rename to home/config/keyd/default.nix diff --git a/user/common/keyd/module/DRG.nix b/home/config/keyd/module/DRG.nix similarity index 100% rename from user/common/keyd/module/DRG.nix rename to home/config/keyd/module/DRG.nix diff --git a/user/common/keyd/module/Firefox.nix b/home/config/keyd/module/Firefox.nix similarity index 100% rename from user/common/keyd/module/Firefox.nix rename to home/config/keyd/module/Firefox.nix diff --git a/user/common/keyd/module/Jetbrains.nix b/home/config/keyd/module/Jetbrains.nix similarity index 100% rename from user/common/keyd/module/Jetbrains.nix rename to home/config/keyd/module/Jetbrains.nix diff --git a/user/common/mako/default.nix b/home/config/mako/default.nix similarity index 100% rename from user/common/mako/default.nix rename to home/config/mako/default.nix diff --git a/module/desktop/mangohud/default.nix b/home/config/mangohud/default.nix similarity index 100% rename from module/desktop/mangohud/default.nix rename to home/config/mangohud/default.nix diff --git a/module/common/nvim/default.nix b/home/config/nvim/default.nix similarity index 99% rename from module/common/nvim/default.nix rename to home/config/nvim/default.nix index 8ff1c54..eb16d8e 100644 --- a/module/common/nvim/default.nix +++ b/home/config/nvim/default.nix @@ -13,7 +13,7 @@ configRc = "lua dofile(\"${config}\")"; in runtimeRc + configRc; in { - config = nvimRc { + text = nvimRc { runtimes = [ "~/.cache/nvim" "~/.cache/nvim/treesitter" diff --git a/module/common/nvim/module/config/Autoread.nix b/home/config/nvim/module/config/Autoread.nix similarity index 100% rename from module/common/nvim/module/config/Autoread.nix rename to home/config/nvim/module/config/Autoread.nix diff --git a/module/common/nvim/module/config/Etc.nix b/home/config/nvim/module/config/Etc.nix similarity index 100% rename from module/common/nvim/module/config/Etc.nix rename to home/config/nvim/module/config/Etc.nix diff --git a/module/common/nvim/module/config/Search.nix b/home/config/nvim/module/config/Search.nix similarity index 100% rename from module/common/nvim/module/config/Search.nix rename to home/config/nvim/module/config/Search.nix diff --git a/module/common/nvim/module/config/Tab.nix b/home/config/nvim/module/config/Tab.nix similarity index 100% rename from module/common/nvim/module/config/Tab.nix rename to home/config/nvim/module/config/Tab.nix diff --git a/module/common/nvim/module/key/Autocomplete.nix b/home/config/nvim/module/key/Autocomplete.nix similarity index 100% rename from module/common/nvim/module/key/Autocomplete.nix rename to home/config/nvim/module/key/Autocomplete.nix diff --git a/module/common/nvim/module/key/Buffer.nix b/home/config/nvim/module/key/Buffer.nix similarity index 100% rename from module/common/nvim/module/key/Buffer.nix rename to home/config/nvim/module/key/Buffer.nix diff --git a/module/common/nvim/module/key/Colorscheme.nix b/home/config/nvim/module/key/Colorscheme.nix similarity index 100% rename from module/common/nvim/module/key/Colorscheme.nix rename to home/config/nvim/module/key/Colorscheme.nix diff --git a/module/common/nvim/module/key/Comment.nix b/home/config/nvim/module/key/Comment.nix similarity index 100% rename from module/common/nvim/module/key/Comment.nix rename to home/config/nvim/module/key/Comment.nix diff --git a/module/common/nvim/module/key/Common.nix b/home/config/nvim/module/key/Common.nix similarity index 100% rename from module/common/nvim/module/key/Common.nix rename to home/config/nvim/module/key/Common.nix diff --git a/module/common/nvim/module/key/Filetree.nix b/home/config/nvim/module/key/Filetree.nix similarity index 100% rename from module/common/nvim/module/key/Filetree.nix rename to home/config/nvim/module/key/Filetree.nix diff --git a/module/common/nvim/module/key/Gitsigns.nix b/home/config/nvim/module/key/Gitsigns.nix similarity index 100% rename from module/common/nvim/module/key/Gitsigns.nix rename to home/config/nvim/module/key/Gitsigns.nix diff --git a/module/common/nvim/module/key/Leader.nix b/home/config/nvim/module/key/Leader.nix similarity index 100% rename from module/common/nvim/module/key/Leader.nix rename to home/config/nvim/module/key/Leader.nix diff --git a/module/common/nvim/module/key/Navigation.nix b/home/config/nvim/module/key/Navigation.nix similarity index 100% rename from module/common/nvim/module/key/Navigation.nix rename to home/config/nvim/module/key/Navigation.nix diff --git a/module/common/nvim/module/key/Ollama.nix b/home/config/nvim/module/key/Ollama.nix similarity index 100% rename from module/common/nvim/module/key/Ollama.nix rename to home/config/nvim/module/key/Ollama.nix diff --git a/module/common/nvim/module/key/Rekey.nix b/home/config/nvim/module/key/Rekey.nix similarity index 100% rename from module/common/nvim/module/key/Rekey.nix rename to home/config/nvim/module/key/Rekey.nix diff --git a/module/common/nvim/module/key/Sort.nix b/home/config/nvim/module/key/Sort.nix similarity index 100% rename from module/common/nvim/module/key/Sort.nix rename to home/config/nvim/module/key/Sort.nix diff --git a/module/common/nvim/module/key/Telescope.nix b/home/config/nvim/module/key/Telescope.nix similarity index 100% rename from module/common/nvim/module/key/Telescope.nix rename to home/config/nvim/module/key/Telescope.nix diff --git a/module/common/nvim/module/key/Terminal.nix b/home/config/nvim/module/key/Terminal.nix similarity index 100% rename from module/common/nvim/module/key/Terminal.nix rename to home/config/nvim/module/key/Terminal.nix diff --git a/module/common/nvim/module/key/Todo.nix b/home/config/nvim/module/key/Todo.nix similarity index 100% rename from module/common/nvim/module/key/Todo.nix rename to home/config/nvim/module/key/Todo.nix diff --git a/module/common/nvim/module/key/Trouble.nix b/home/config/nvim/module/key/Trouble.nix similarity index 100% rename from module/common/nvim/module/key/Trouble.nix rename to home/config/nvim/module/key/Trouble.nix diff --git a/module/common/nvim/module/key/Whichkey.nix b/home/config/nvim/module/key/Whichkey.nix similarity index 100% rename from module/common/nvim/module/key/Whichkey.nix rename to home/config/nvim/module/key/Whichkey.nix diff --git a/module/common/nvim/module/plugin/Align.nix b/home/config/nvim/module/plugin/Align.nix similarity index 100% rename from module/common/nvim/module/plugin/Align.nix rename to home/config/nvim/module/plugin/Align.nix diff --git a/module/common/nvim/module/plugin/Autoclose.nix b/home/config/nvim/module/plugin/Autoclose.nix similarity index 100% rename from module/common/nvim/module/plugin/Autoclose.nix rename to home/config/nvim/module/plugin/Autoclose.nix diff --git a/module/common/nvim/module/plugin/Bufferline.nix b/home/config/nvim/module/plugin/Bufferline.nix similarity index 100% rename from module/common/nvim/module/plugin/Bufferline.nix rename to home/config/nvim/module/plugin/Bufferline.nix diff --git a/module/common/nvim/module/plugin/Closebuffers.nix b/home/config/nvim/module/plugin/Closebuffers.nix similarity index 100% rename from module/common/nvim/module/plugin/Closebuffers.nix rename to home/config/nvim/module/plugin/Closebuffers.nix diff --git a/module/common/nvim/module/plugin/Colorizer.nix b/home/config/nvim/module/plugin/Colorizer.nix similarity index 100% rename from module/common/nvim/module/plugin/Colorizer.nix rename to home/config/nvim/module/plugin/Colorizer.nix diff --git a/module/common/nvim/module/plugin/Filetree.nix b/home/config/nvim/module/plugin/Filetree.nix similarity index 100% rename from module/common/nvim/module/plugin/Filetree.nix rename to home/config/nvim/module/plugin/Filetree.nix diff --git a/module/common/nvim/module/plugin/Fold.nix b/home/config/nvim/module/plugin/Fold.nix similarity index 100% rename from module/common/nvim/module/plugin/Fold.nix rename to home/config/nvim/module/plugin/Fold.nix diff --git a/module/common/nvim/module/plugin/Gitsigns.nix b/home/config/nvim/module/plugin/Gitsigns.nix similarity index 100% rename from module/common/nvim/module/plugin/Gitsigns.nix rename to home/config/nvim/module/plugin/Gitsigns.nix diff --git a/module/common/nvim/module/plugin/Gruvbox.nix b/home/config/nvim/module/plugin/Gruvbox.nix similarity index 100% rename from module/common/nvim/module/plugin/Gruvbox.nix rename to home/config/nvim/module/plugin/Gruvbox.nix diff --git a/module/common/nvim/module/plugin/Indent.nix b/home/config/nvim/module/plugin/Indent.nix similarity index 100% rename from module/common/nvim/module/plugin/Indent.nix rename to home/config/nvim/module/plugin/Indent.nix diff --git a/module/common/nvim/module/plugin/Init.nix b/home/config/nvim/module/plugin/Init.nix similarity index 100% rename from module/common/nvim/module/plugin/Init.nix rename to home/config/nvim/module/plugin/Init.nix diff --git a/module/common/nvim/module/plugin/Ollama.nix b/home/config/nvim/module/plugin/Ollama.nix similarity index 100% rename from module/common/nvim/module/plugin/Ollama.nix rename to home/config/nvim/module/plugin/Ollama.nix diff --git a/module/common/nvim/module/plugin/Telescope.nix b/home/config/nvim/module/plugin/Telescope.nix similarity index 100% rename from module/common/nvim/module/plugin/Telescope.nix rename to home/config/nvim/module/plugin/Telescope.nix diff --git a/module/common/nvim/module/plugin/Todo.nix b/home/config/nvim/module/plugin/Todo.nix similarity index 100% rename from module/common/nvim/module/plugin/Todo.nix rename to home/config/nvim/module/plugin/Todo.nix diff --git a/module/common/nvim/module/plugin/Tokyonight.nix b/home/config/nvim/module/plugin/Tokyonight.nix similarity index 100% rename from module/common/nvim/module/plugin/Tokyonight.nix rename to home/config/nvim/module/plugin/Tokyonight.nix diff --git a/module/common/nvim/module/plugin/Treesitter.nix b/home/config/nvim/module/plugin/Treesitter.nix similarity index 100% rename from module/common/nvim/module/plugin/Treesitter.nix rename to home/config/nvim/module/plugin/Treesitter.nix diff --git a/module/common/nvim/module/plugin/Trouble.nix b/home/config/nvim/module/plugin/Trouble.nix similarity index 100% rename from module/common/nvim/module/plugin/Trouble.nix rename to home/config/nvim/module/plugin/Trouble.nix diff --git a/module/common/nvim/module/plugin/lsp/Haskell.nix b/home/config/nvim/module/plugin/lsp/Haskell.nix similarity index 100% rename from module/common/nvim/module/plugin/lsp/Haskell.nix rename to home/config/nvim/module/plugin/lsp/Haskell.nix diff --git a/module/common/nvim/module/plugin/lsp/Kotlin.nix b/home/config/nvim/module/plugin/lsp/Kotlin.nix similarity index 100% rename from module/common/nvim/module/plugin/lsp/Kotlin.nix rename to home/config/nvim/module/plugin/lsp/Kotlin.nix diff --git a/module/common/nvim/module/plugin/lsp/Nix.nix b/home/config/nvim/module/plugin/lsp/Nix.nix similarity index 100% rename from module/common/nvim/module/plugin/lsp/Nix.nix rename to home/config/nvim/module/plugin/lsp/Nix.nix diff --git a/module/common/nvim/module/plugin/lsp/Python.nix b/home/config/nvim/module/plugin/lsp/Python.nix similarity index 100% rename from module/common/nvim/module/plugin/lsp/Python.nix rename to home/config/nvim/module/plugin/lsp/Python.nix diff --git a/module/common/nvim/module/plugin/lsp/Rust.nix b/home/config/nvim/module/plugin/lsp/Rust.nix similarity index 100% rename from module/common/nvim/module/plugin/lsp/Rust.nix rename to home/config/nvim/module/plugin/lsp/Rust.nix diff --git a/module/common/nvim/module/plugin/lsp/Tex.nix b/home/config/nvim/module/plugin/lsp/Tex.nix similarity index 100% rename from module/common/nvim/module/plugin/lsp/Tex.nix rename to home/config/nvim/module/plugin/lsp/Tex.nix diff --git a/module/common/ssh/default.nix b/home/config/ssh/default.nix similarity index 96% rename from module/common/ssh/default.nix rename to home/config/ssh/default.nix index f94e638..e01571e 100644 --- a/module/common/ssh/default.nix +++ b/home/config/ssh/default.nix @@ -1,6 +1,6 @@ # SSH client configuration. { util, ... }: { - config = util.trimTabs '' + text = util.trimTabs '' Host dasha HostName 192.168.1.7 User root diff --git a/module/desktop/sway/default.nix b/home/config/sway/default.nix similarity index 89% rename from module/desktop/sway/default.nix rename to home/config/sway/default.nix index 4ed03e1..f842f0d 100644 --- a/module/desktop/sway/default.nix +++ b/home/config/sway/default.nix @@ -24,11 +24,9 @@ ./module/System.nix ] args; in { - config = (util.trimTabs '' + text = (util.trimTabs '' # Read `man 5 sway` for a complete reference. include /etc/sway/config.d/* '') + swayRc; - - script = util.catText (util.ls ./script) args + "\${@}"; } diff --git a/module/desktop/sway/module/Brightness.nix b/home/config/sway/module/Brightness.nix similarity index 100% rename from module/desktop/sway/module/Brightness.nix rename to home/config/sway/module/Brightness.nix diff --git a/module/desktop/sway/module/Display.nix b/home/config/sway/module/Display.nix similarity index 100% rename from module/desktop/sway/module/Display.nix rename to home/config/sway/module/Display.nix diff --git a/module/desktop/sway/module/Font.nix b/home/config/sway/module/Font.nix similarity index 100% rename from module/desktop/sway/module/Font.nix rename to home/config/sway/module/Font.nix diff --git a/module/desktop/sway/module/Input.nix b/home/config/sway/module/Input.nix similarity index 100% rename from module/desktop/sway/module/Input.nix rename to home/config/sway/module/Input.nix diff --git a/module/desktop/sway/module/Keyd.nix b/home/config/sway/module/Keyd.nix similarity index 100% rename from module/desktop/sway/module/Keyd.nix rename to home/config/sway/module/Keyd.nix diff --git a/module/desktop/sway/module/Launcher.nix b/home/config/sway/module/Launcher.nix similarity index 100% rename from module/desktop/sway/module/Launcher.nix rename to home/config/sway/module/Launcher.nix diff --git a/module/desktop/sway/module/Mod.nix b/home/config/sway/module/Mod.nix similarity index 100% rename from module/desktop/sway/module/Mod.nix rename to home/config/sway/module/Mod.nix diff --git a/module/desktop/sway/module/Navigation.nix b/home/config/sway/module/Navigation.nix similarity index 100% rename from module/desktop/sway/module/Navigation.nix rename to home/config/sway/module/Navigation.nix diff --git a/module/desktop/sway/module/Notification.nix b/home/config/sway/module/Notification.nix similarity index 100% rename from module/desktop/sway/module/Notification.nix rename to home/config/sway/module/Notification.nix diff --git a/module/desktop/sway/module/Resize.nix b/home/config/sway/module/Resize.nix similarity index 100% rename from module/desktop/sway/module/Resize.nix rename to home/config/sway/module/Resize.nix diff --git a/module/desktop/sway/module/ScratchPad.nix b/home/config/sway/module/ScratchPad.nix similarity index 100% rename from module/desktop/sway/module/ScratchPad.nix rename to home/config/sway/module/ScratchPad.nix diff --git a/module/desktop/sway/module/Screenshot.nix b/home/config/sway/module/Screenshot.nix similarity index 100% rename from module/desktop/sway/module/Screenshot.nix rename to home/config/sway/module/Screenshot.nix diff --git a/module/desktop/sway/module/Session.nix b/home/config/sway/module/Session.nix similarity index 100% rename from module/desktop/sway/module/Session.nix rename to home/config/sway/module/Session.nix diff --git a/module/desktop/sway/module/Sound.nix b/home/config/sway/module/Sound.nix similarity index 100% rename from module/desktop/sway/module/Sound.nix rename to home/config/sway/module/Sound.nix diff --git a/module/desktop/sway/module/Style.nix b/home/config/sway/module/Style.nix similarity index 92% rename from module/desktop/sway/module/Style.nix rename to home/config/sway/module/Style.nix index 9d7b1f8..11404ba 100644 --- a/module/desktop/sway/module/Style.nix +++ b/home/config/sway/module/Style.nix @@ -6,7 +6,7 @@ fg = config.style.color.fg.light; in { text = '' - output * bg ${config.module.common.wallpaper.path} fill + output * bg ${config.module.wallpaper.path} fill client.focused "#${accent}" "#${bg}" "#${fg}" "#${accent}" "#${accent}" client.focused_inactive "#${border}" "#${bg}" "#${fg}" "#${border}" "#${border}" client.unfocused "#${border}" "#${bg}" "#${fg}" "#${border}" "#${border}" diff --git a/module/desktop/sway/module/System.nix b/home/config/sway/module/System.nix similarity index 100% rename from module/desktop/sway/module/System.nix rename to home/config/sway/module/System.nix diff --git a/module/desktop/sway/module/Terminal.nix b/home/config/sway/module/Terminal.nix similarity index 100% rename from module/desktop/sway/module/Terminal.nix rename to home/config/sway/module/Terminal.nix diff --git a/module/desktop/sway/module/Tiling.nix b/home/config/sway/module/Tiling.nix similarity index 100% rename from module/desktop/sway/module/Tiling.nix rename to home/config/sway/module/Tiling.nix diff --git a/module/desktop/sway/module/TitleBar.nix b/home/config/sway/module/TitleBar.nix similarity index 100% rename from module/desktop/sway/module/TitleBar.nix rename to home/config/sway/module/TitleBar.nix diff --git a/module/desktop/sway/module/Waybar.nix b/home/config/sway/module/Waybar.nix similarity index 61% rename from module/desktop/sway/module/Waybar.nix rename to home/config/sway/module/Waybar.nix index 9d0a1b2..dba16b6 100644 --- a/module/desktop/sway/module/Waybar.nix +++ b/home/config/sway/module/Waybar.nix @@ -1,7 +1,7 @@ { ... }: { text = '' bindsym $mod+r exec pkill -SIGUSR1 waybar - exec waybar -c ''${WAYBAR_CONFIG} -s ''${WAYBAR_STYLE} + exec waybar exec nm-applet ''; } diff --git a/module/desktop/sway/module/Workspace.nix b/home/config/sway/module/Workspace.nix similarity index 100% rename from module/desktop/sway/module/Workspace.nix rename to home/config/sway/module/Workspace.nix diff --git a/user/common/template/Android.nix b/home/config/template/Android.nix similarity index 100% rename from user/common/template/Android.nix rename to home/config/template/Android.nix diff --git a/user/common/template/DevShell.nix b/home/config/template/DevShell.nix similarity index 100% rename from user/common/template/DevShell.nix rename to home/config/template/DevShell.nix diff --git a/user/common/template/FHSEnv.nix b/home/config/template/FHSEnv.nix similarity index 100% rename from user/common/template/FHSEnv.nix rename to home/config/template/FHSEnv.nix diff --git a/user/common/template/Latex.nix b/home/config/template/Latex.nix similarity index 100% rename from user/common/template/Latex.nix rename to home/config/template/Latex.nix diff --git a/user/common/template/Rust.nix b/home/config/template/Rust.nix similarity index 100% rename from user/common/template/Rust.nix rename to home/config/template/Rust.nix diff --git a/home/config/tmux/default.nix b/home/config/tmux/default.nix new file mode 100644 index 0000000..c0d1f9d --- /dev/null +++ b/home/config/tmux/default.nix @@ -0,0 +1,3 @@ +{ util, config, ... } @args: { + text = util.catText (util.ls ./module) args; +} diff --git a/module/common/tmux/module/Config.nix b/home/config/tmux/module/Config.nix similarity index 100% rename from module/common/tmux/module/Config.nix rename to home/config/tmux/module/Config.nix diff --git a/module/common/tmux/module/Copy.nix b/home/config/tmux/module/Copy.nix similarity index 100% rename from module/common/tmux/module/Copy.nix rename to home/config/tmux/module/Copy.nix diff --git a/module/common/tmux/module/Env.nix b/home/config/tmux/module/Env.nix similarity index 100% rename from module/common/tmux/module/Env.nix rename to home/config/tmux/module/Env.nix diff --git a/module/common/tmux/module/Scroll.nix b/home/config/tmux/module/Scroll.nix similarity index 100% rename from module/common/tmux/module/Scroll.nix rename to home/config/tmux/module/Scroll.nix diff --git a/module/common/tmux/module/Session.nix b/home/config/tmux/module/Session.nix similarity index 100% rename from module/common/tmux/module/Session.nix rename to home/config/tmux/module/Session.nix diff --git a/module/common/tmux/module/Split.nix b/home/config/tmux/module/Split.nix similarity index 100% rename from module/common/tmux/module/Split.nix rename to home/config/tmux/module/Split.nix diff --git a/module/common/tmux/module/Status.nix b/home/config/tmux/module/Status.nix similarity index 100% rename from module/common/tmux/module/Status.nix rename to home/config/tmux/module/Status.nix diff --git a/module/common/tmux/module/Window.nix b/home/config/tmux/module/Window.nix similarity index 100% rename from module/common/tmux/module/Window.nix rename to home/config/tmux/module/Window.nix diff --git a/user/common/top/btop/default.nix b/home/config/top/btop/default.nix similarity index 100% rename from user/common/top/btop/default.nix rename to home/config/top/btop/default.nix diff --git a/user/common/top/htop/default.nix b/home/config/top/htop/default.nix similarity index 100% rename from user/common/top/htop/default.nix rename to home/config/top/htop/default.nix diff --git a/module/desktop/waybar/config/default.nix b/home/config/waybar/config/default.nix similarity index 100% rename from module/desktop/waybar/config/default.nix rename to home/config/waybar/config/default.nix diff --git a/module/desktop/waybar/default.nix b/home/config/waybar/default.nix similarity index 100% rename from module/desktop/waybar/default.nix rename to home/config/waybar/default.nix diff --git a/module/desktop/waybar/style/Common.nix b/home/config/waybar/style/Common.nix similarity index 100% rename from module/desktop/waybar/style/Common.nix rename to home/config/waybar/style/Common.nix diff --git a/module/desktop/waybar/style/Plugin.nix b/home/config/waybar/style/Plugin.nix similarity index 100% rename from module/desktop/waybar/style/Plugin.nix rename to home/config/waybar/style/Plugin.nix diff --git a/module/desktop/waybar/style/Window.nix b/home/config/waybar/style/Window.nix similarity index 100% rename from module/desktop/waybar/style/Window.nix rename to home/config/waybar/style/Window.nix diff --git a/user/common/yazi/default.nix b/home/config/yazi/default.nix similarity index 100% rename from user/common/yazi/default.nix rename to home/config/yazi/default.nix diff --git a/user/common/yazi/module/Init.nix b/home/config/yazi/module/Init.nix similarity index 100% rename from user/common/yazi/module/Init.nix rename to home/config/yazi/module/Init.nix diff --git a/user/common/yazi/module/Keymap.nix b/home/config/yazi/module/Keymap.nix similarity index 100% rename from user/common/yazi/module/Keymap.nix rename to home/config/yazi/module/Keymap.nix diff --git a/user/common/yazi/module/Theme.nix b/home/config/yazi/module/Theme.nix similarity index 100% rename from user/common/yazi/module/Theme.nix rename to home/config/yazi/module/Theme.nix diff --git a/user/common/yazi/module/Yazi.nix b/home/config/yazi/module/Yazi.nix similarity index 100% rename from user/common/yazi/module/Yazi.nix rename to home/config/yazi/module/Yazi.nix diff --git a/home/program/default.nix b/home/program/default.nix new file mode 100644 index 0000000..124c4f0 --- /dev/null +++ b/home/program/default.nix @@ -0,0 +1,10 @@ +{ secret, ... } @args: { + home-manager.enable = true; + + gpg = { + enable = true; + inherit (secret.crypto) publicKeys; + }; + + firefox = import ./firefox args; +} diff --git a/home/program/firefox/default.nix b/home/program/firefox/default.nix new file mode 100644 index 0000000..23d1386 --- /dev/null +++ b/home/program/firefox/default.nix @@ -0,0 +1,105 @@ +{ util, pkgs, config, ... }: let + extraConfig = util.trimTabs '' + // Bookmarks. + user_pref("browser.microsummary.enabled", true); + user_pref("browser.places.importBookmarksHTML", true); + user_pref("browser.toolbars.bookmarks.visibility", "never"); + + // Fonts. + user_pref("browser.display.use_document_fonts", 0); + user_pref("font.minimum-size.x-cyrillic", ${toString config.style.font.size.application}); + user_pref("font.minimum-size.x-unicode", ${toString config.style.font.size.application}); + user_pref("font.minimum-size.x-western", ${toString config.style.font.size.application}); + user_pref("font.name.monospace.x-cyrillic", "${config.style.font.monospace.name}"); + user_pref("font.name.monospace.x-unicode", "${config.style.font.monospace.name}"); + user_pref("font.name.monospace.x-western", "${config.style.font.monospace.name}"); + user_pref("font.name.sans-serif.x-cyrillic", "${config.style.font.sansSerif.name}"); + user_pref("font.name.sans-serif.x-unicode", "${config.style.font.sansSerif.name}"); + user_pref("font.name.sans-serif.x-western", "${config.style.font.sansSerif.name}"); + user_pref("font.name.serif.x-cyrillic", "${config.style.font.serif.name}"); + user_pref("font.name.serif.x-unicode", "${config.style.font.serif.name}"); + user_pref("font.name.serif.x-western", "${config.style.font.serif.name}"); + + // Animations. + user_pref("browser.fullscreen.animateUp", 0); + user_pref("browser.fullscreen.autohide", true); + + // Homepage. + user_pref("browser.newtabpage.enabled", false); + user_pref("browser.startup.homepage", "https://home.voronind.com/"); + user_pref("browser.startup.page", 3); + + // Passwords. + user_pref("signon.prefillForms", false); + user_pref("signon.rememberSignons", false); + + // Formats. + user_pref("image.jxl.enabled", true); + + // User agent. + // user_pref("general.useragent.override", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36"); + ''; + + mkExtension = install_url: { + inherit install_url; + installation_mode = "force_installed"; + }; + + mkBookmark = name: url: { inherit name url; }; +in { + enable = true; + package = pkgs.firefox-esr; + # languagePacks = [ "en-US" "ru" ]; + profiles.default = { + inherit extraConfig; + }; + policies = { + ManagedBookmarks = [ + { toplevel_name = "Pin"; } + (mkBookmark "Dashboard" "https://home.voronind.com") + (mkBookmark "Music" "https://music.yandex.ru") + (mkBookmark "Telegram" "https://web.telegram.org/a") + (mkBookmark "Discord" "https://discord.com") + (mkBookmark "WorkMail" "https://mail.fsight.ru") + (mkBookmark "Git" "https://git.voronind.com") + (mkBookmark "WorkGit" "https://git.fmp.fsight.world") + (mkBookmark "WorkBoard" "https://support.fsight.ru") + (mkBookmark "Hass" "https://iot.voronind.com") + (mkBookmark "Cloud" "https://cloud.voronind.com") + ]; + ExtensionUpdate = true; + ExtensionSettings = { + # Block extension installation outside of this config. + "*" = { + install_sources = [ "*" ]; + installation_mode = "blocked"; + }; + "addon@darkreader.org" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; + "cliget@zaidabdulla.com" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/cliget/latest.xpi"; + "uBlock0@raymondhill.net" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; + "{d7742d87-e61d-4b78-b8a1-b469842139fa}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi"; + "{e7625f06-e252-479d-ac7a-db68aeaff2cb}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/togglefonts/latest.xpi"; + "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi"; + # NOTE: This extension is helpful to find the required parameters for this config. + # Or find them yourself inside the `about:support`. + # "queryamoid@kaply.com" = mkExtension "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; + }; + # NOTE: `firefox-esr` edition is required to change default search engine. + SearchEngines = { + Default = "Searx"; + Add = [ + { + Alias = "s"; + Description = "Searx Search"; + IconURL = "https://search.voronind.com/favicon.ico"; + Method = "POST"; + Name = "Searx"; + PostData = "q={searchTerms}"; + # SuggestURLTemplate = "https://search.voronind.com/autocomplete?q={searchTerms}"; + URLTemplate = "https://search.voronind.com/search?q=%{searchTerms}"; + } + ]; + }; + }; +} diff --git a/user/Dasha.nix b/home/user/Dasha.nix similarity index 68% rename from user/Dasha.nix rename to home/user/Dasha.nix index 73f23fb..cfa5bcc 100644 --- a/user/Dasha.nix +++ b/home/user/Dasha.nix @@ -1,21 +1,16 @@ -{ const -, util -, style -, pkgs -, lib +{ lib , config -, key -, secret -, ... } @args: with lib; let +, ... }: with lib; let cfg = config.user.dasha; in { options = { - user.dasha.enable = mkEnableOption "dasha"; + user.dasha = { + enable = mkEnableOption "dasha"; + }; }; config = mkIf cfg.enable { - user.common.users = [{ name = "dasha"; homeDir = "/home/dasha"; }]; - + home.nixos.users = [{ username = "dasha"; homeDirectory = "/home/dasha"; }]; users.users.dasha = { createHome = true; description = "Daria Dranchak"; diff --git a/home/user/Root.nix b/home/user/Root.nix new file mode 100644 index 0000000..2d33679 --- /dev/null +++ b/home/user/Root.nix @@ -0,0 +1,23 @@ +{ lib +, config +, secret +, ... }: with lib; let + cfg = config.user.root; +in { + options = { + user.root = { + enable = mkEnableOption "root" // { default = true; }; + }; + }; + + config = mkIf cfg.enable { + home.nixos.users = [{ username = "root"; homeDirectory = "/root"; }]; + users.users.root.hashedPassword = secret.hashedPassword; + security.sudo = { + enable = false; + extraConfig = '' + Defaults rootpw + ''; + }; + }; +} diff --git a/user/Voronind.nix b/home/user/Voronind.nix similarity index 66% rename from user/Voronind.nix rename to home/user/Voronind.nix index 5b8446c..e0c4750 100644 --- a/user/Voronind.nix +++ b/home/user/Voronind.nix @@ -1,21 +1,17 @@ -{ const -, util -, style -, pkgs -, lib +{ lib , config -, key , secret -, ... } @args: with lib; let +, ... }: with lib; let cfg = config.user.voronind; in { options = { - user.voronind.enable = mkEnableOption "voronind"; + user.voronind = { + enable = mkEnableOption "voronind"; + }; }; config = mkIf cfg.enable { - user.common.users = [{ name = "voronind"; homeDir = "/home/voronind"; }]; - + home.nixos.users = [{ username = "voronind"; homeDirectory = "/home/voronind"; }]; users.users.voronind = { createHome = true; description = "Dmitry Voronin"; diff --git a/home/variable/default.nix b/home/variable/default.nix new file mode 100644 index 0000000..c718e08 --- /dev/null +++ b/home/variable/default.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: { + # Default text editor. + EDITOR = "nvim"; + + # App to use for man pages. + MANPAGER = "nvim +Man!"; + + # Allow unfree packages in shell. + NIXPKGS_ALLOW_UNFREE = "1"; + + # Current system architecture. + NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}"; + + # Enable Mangohud by default. + MANGOHUD = "1"; + + # Use fsync for Wine. + WINEFSYNC = "1"; + + # Disable Firefox profile switching on rebuild. + MOZ_LEGACY_PROFILES = "1"; + + # GTK apps compat. + GTK_CSD = 0; + + # Terminal settings. + TERM = "xterm-256color"; +} diff --git a/home/xdg/default.nix b/home/xdg/default.nix new file mode 100644 index 0000000..32538ea --- /dev/null +++ b/home/xdg/default.nix @@ -0,0 +1,17 @@ +{ homeDirectory, ... }: { + userDirs = { + enable = true; + createDirectories = true; + desktop = "${homeDirectory}/"; + documents = "${homeDirectory}/document/"; + download = "${homeDirectory}/download/"; + music = "${homeDirectory}/media/music/"; + pictures = "${homeDirectory}/media/picture/"; + publicShare = "${homeDirectory}/media/share/"; + templates = "${homeDirectory}/media/template/"; + videos = "${homeDirectory}/media/video/"; + extraConfig = { + XDG_TMP_DIR = "${homeDirectory}/tmp/"; + }; + }; +} diff --git a/host/dasha/default.nix b/host/dasha/default.nix index 017fa84..1dc0ff9 100644 --- a/host/dasha/default.nix +++ b/host/dasha/default.nix @@ -3,11 +3,12 @@ ./Filesystem.nix ]; + home.nixos.enable = true; user.dasha.enable = true; module = { amd.gpu.enable = true; - builder.client.enable = true; + # builder.client.enable = true; intel.cpu.enable = true; print.enable = true; strongswan.enable = true; @@ -16,6 +17,7 @@ sway.enable = true; app = { common.enable = true; + desktop.enable = true; gaming.enable = true; creative.enable = true; dev.enable = true; diff --git a/host/desktop/default.nix b/host/desktop/default.nix index 33b6563..a085dc1 100644 --- a/host/desktop/default.nix +++ b/host/desktop/default.nix @@ -3,10 +3,11 @@ ./Filesystem.nix ]; + home.nixos.enable = true; user.voronind.enable = true; module = { - builder.client.enable = true; + # builder.client.enable = true; print.enable = true; virtmanager.enable = true; amd = { @@ -18,6 +19,7 @@ sway.enable = true; app = { common.enable = true; + desktop.enable = true; creative.enable = true; dev.enable = true; extra.enable = true; diff --git a/host/fsight/default.nix b/host/fsight/default.nix index c9f837b..b977788 100644 --- a/host/fsight/default.nix +++ b/host/fsight/default.nix @@ -4,6 +4,7 @@ ./Root.nix ]; + home.nixos.enable = true; module.docker = { enable = true; autostart = true; diff --git a/host/home/Backup.nix b/host/home/Backup.nix index 19a6781..b59e9ad 100644 --- a/host/home/Backup.nix +++ b/host/home/Backup.nix @@ -1,7 +1,7 @@ -{ pkgs, util, ... } @args: let - bash = import ../../module/common/bash args; +{ pkgs, util, __findFile, ... } @args: let + bash = import args; script = pkgs.writeText "backupScript" '' - source ${bash.modules} + source ${bash.modulesFile} function report() { echo "''${*}" diff --git a/host/home/YaMusicDownload.nix b/host/home/YaMusicDownload.nix index c189590..2578f27 100644 --- a/host/home/YaMusicDownload.nix +++ b/host/home/YaMusicDownload.nix @@ -1,6 +1,6 @@ -{ pkgs, util, lib, ... }: let +{ pkgs, util, lib, __findFile, ... }: let storage = "/storage/hot/media/music"; - package = import ./yamusicdownload { inherit pkgs; }; + package = import { inherit pkgs; }; pattern = "#album-artist/#year_#album/#number_#title"; in { systemd.user = { diff --git a/host/home/default.nix b/host/home/default.nix index ad75734..b8a7eb4 100644 --- a/host/home/default.nix +++ b/host/home/default.nix @@ -8,14 +8,17 @@ ./YaMusicDownload.nix ]; + home.nixos.enable = true; user.voronind.enable = true; module = { + autoupdate.enable = false; builder.server.enable = true; desktop = { sway.enable = true; app = { - common.enable = true; + common.enable = true; + desktop.enable = true; }; }; ftpd = { @@ -30,7 +33,4 @@ gpu.enable = true; }; }; - - # Disable auto-switch. - module.common.autoupdate.enable = false; } diff --git a/host/laptop/default.nix b/host/laptop/default.nix index 6729caa..05739b0 100644 --- a/host/laptop/default.nix +++ b/host/laptop/default.nix @@ -3,13 +3,14 @@ ./Filesystem.nix ]; + home.nixos.enable = true; user = { dasha.enable = true; voronind.enable = true; }; module = { - builder.client.enable = true; + # builder.client.enable = true; print.enable = true; strongswan.enable = true; tablet.enable = true; @@ -22,6 +23,7 @@ sway.enable = true; app = { common.enable = true; + desktop.enable = true; gaming.enable = true; creative.enable = true; dev.enable = true; diff --git a/host/live/default.nix b/host/live/default.nix index c915eb0..2e88477 100644 --- a/host/live/default.nix +++ b/host/live/default.nix @@ -1 +1,3 @@ -{ ... }: { } +{ ... }: { + home.nixos.enable = true; +} diff --git a/host/work/default.nix b/host/work/default.nix index a091a16..30348c7 100644 --- a/host/work/default.nix +++ b/host/work/default.nix @@ -6,10 +6,11 @@ # Keyd Print to Macro remap. services.keyd.keyboards.default.settings.main.print = "layer(layer_macro)"; + home.nixos.enable = true; user.voronind.enable = true; module = { - builder.client.enable = true; + # builder.client.enable = true; intel.cpu.enable = true; powerlimit.thinkpad.enable = true; print.enable = true; @@ -17,6 +18,7 @@ sway.enable = true; app = { common.enable = true; + desktop.enable = true; gaming.enable = true; dev.enable = true; extra.enable = true; diff --git a/module/App.nix b/module/App.nix new file mode 100644 index 0000000..5db7338 --- /dev/null +++ b/module/App.nix @@ -0,0 +1,72 @@ +{ pkgs, config, lib, __findFile, ... } @args: with lib; let + cfg = config.module.desktop.app; + package = import args; +in { + options = { + module.desktop.app = { + common.enable = mkEnableOption "Common Apps."; + desktop.enable = mkEnableOption "Desktop Apps."; + gaming.enable = mkEnableOption "Gaming Apps."; + creative.enable = mkEnableOption "Creative Apps."; + dev.enable = mkEnableOption "Dev Apps."; + extra.enable = mkEnableOption "Extra Apps."; + }; + }; + + config = mkMerge [ + # Common apps. + (mkIf cfg.common.enable { + xdg.mime.defaultApplications = { + # Use `file -i file.txt` to find file mime type. + # Use `xdg-mime query default "text/plain"` to find default app. + "application/pdf" = "org.gnome.Evince.desktop"; + "application/vnd.openxmlformats-officedocument.*" = "onlyoffice-desktopeditors.desktop"; + "audio/*" = "mpv.desktop"; + "image/*" = "org.gnome.Loupe.desktop"; + "text/*" = "nvim.desktop"; + "video/*" = "mpv.desktop"; + }; + + environment.systemPackages = package.common; + }) + + # Desktop apps. + (mkIf cfg.desktop.enable { + environment.systemPackages = package.desktop; + }) + + # Gaming. + (mkIf cfg.gaming.enable { + hardware.graphics = let + packages = with pkgs; [ + dxvk + gamescope + pkgs.mangohud + vkd3d + ]; + in { + extraPackages = packages; + extraPackages32 = packages; + }; + + programs.steam.enable = true; + + environment.systemPackages = package.gaming; + }) + + # Creative. + (mkIf cfg.creative.enable { + environment.systemPackages = package.creative; + }) + + # Development. + (mkIf cfg.dev.enable { + environment.systemPackages = package.dev; + }) + + # Extras. + (mkIf cfg.extra.enable { + environment.systemPackages = package.extra; + }) + ]; +} diff --git a/module/common/AutoUpdateSigned.nix b/module/AutoUpdateSigned.nix similarity index 94% rename from module/common/AutoUpdateSigned.nix rename to module/AutoUpdateSigned.nix index afe1b96..a08d5f9 100644 --- a/module/common/AutoUpdateSigned.nix +++ b/module/AutoUpdateSigned.nix @@ -3,10 +3,10 @@ # Unlike system.autoUpgrade, this script also verifies my git signature # to prevent unathorized changes to hosts. { const, pkgs, lib, util, config, ... }: with lib; let - cfg = config.module.common.autoupdate; + cfg = config.module.autoupdate; in { options = { - module.common.autoupdate = { + module.autoupdate = { enable = mkEnableOption "System auto-updates." // { default = true; }; }; }; diff --git a/module/Bash.nix b/module/Bash.nix new file mode 100644 index 0000000..d7452c2 --- /dev/null +++ b/module/Bash.nix @@ -0,0 +1,4 @@ +{ lib, ... } @args: { + # Remove default aliases for `l`, `ll` etc as they break my function definitions. + environment.shellAliases = lib.mkForce {}; +} diff --git a/module/desktop/Bluetooth.nix b/module/Bluetooth.nix similarity index 100% rename from module/desktop/Bluetooth.nix rename to module/Bluetooth.nix diff --git a/module/common/Bootloader.nix b/module/Bootloader.nix similarity index 100% rename from module/common/Bootloader.nix rename to module/Bootloader.nix diff --git a/module/desktop/Brightness.nix b/module/Brightness.nix similarity index 100% rename from module/desktop/Brightness.nix rename to module/Brightness.nix diff --git a/module/common/Crypto.nix b/module/Crypto.nix similarity index 100% rename from module/common/Crypto.nix rename to module/Crypto.nix diff --git a/module/desktop/DisplayManager.nix b/module/DisplayManager.nix similarity index 100% rename from module/desktop/DisplayManager.nix rename to module/DisplayManager.nix diff --git a/module/common/Distrobox.nix b/module/Distrobox.nix similarity index 81% rename from module/common/Distrobox.nix rename to module/Distrobox.nix index 7c38647..ece43a5 100644 --- a/module/common/Distrobox.nix +++ b/module/Distrobox.nix @@ -1,8 +1,8 @@ { pkgs, lib, config, ... }: with lib; let - cfg = config.module.common.distrobox; + cfg = config.module.distrobox; in { options = { - module.common.distrobox = { + module.distrobox = { enable = mkEnableOption "Distrobox." // { default = true; }; }; }; diff --git a/module/common/Filesystem.nix b/module/Filesystem.nix similarity index 100% rename from module/common/Filesystem.nix rename to module/Filesystem.nix diff --git a/module/common/Firewall.nix b/module/Firewall.nix similarity index 100% rename from module/common/Firewall.nix rename to module/Firewall.nix diff --git a/module/common/Font.nix b/module/Font.nix similarity index 79% rename from module/common/Font.nix rename to module/Font.nix index a4548fb..8bc8ce4 100644 --- a/module/common/Font.nix +++ b/module/Font.nix @@ -1,7 +1,7 @@ -{ pkgs, ... }: { +{ pkgs, __findFile, ... }: { fonts.packages = with pkgs; [ # Use Apple fonts for system and text. - (pkgs.callPackage ./applefont {}) + (pkgs.callPackage {}) # Use Nerd version of Terminus for monospaced fonts. (nerdfonts.override { fonts = [ "Terminus" ]; }) diff --git a/module/desktop/Gnome.nix b/module/Gnome.nix similarity index 97% rename from module/desktop/Gnome.nix rename to module/Gnome.nix index 80b6632..fbebb1a 100644 --- a/module/desktop/Gnome.nix +++ b/module/Gnome.nix @@ -8,7 +8,6 @@ in { config = mkIf cfg.enable { module.desktop = { app.common.enable = true; - dconf.enable = true; dm.enable = true; sound.enable = true; wayland.enable = true; diff --git a/module/common/Kernel.nix b/module/Kernel.nix similarity index 96% rename from module/common/Kernel.nix rename to module/Kernel.nix index 47037dd..0b99b1f 100644 --- a/module/common/Kernel.nix +++ b/module/Kernel.nix @@ -1,8 +1,8 @@ { pkgs, config, lib, ... }: with lib; let - cfg = config.module.common.kernel; + cfg = config.module.kernel; in { options = { - module.common.kernel = { + module.kernel = { latest = mkOption { default = true; type = types.bool; diff --git a/module/common/Keyd.nix b/module/Keyd.nix similarity index 96% rename from module/common/Keyd.nix rename to module/Keyd.nix index 830f488..2fc0cfb 100644 --- a/module/common/Keyd.nix +++ b/module/Keyd.nix @@ -1,8 +1,8 @@ { pkgs, config, lib, ... }: with lib; let - cfg = config.module.common.keyd; + cfg = config.module.keyd; in { options = { - module.common.keyd = { + module.keyd = { enable = mkEnableOption "Keyboard remaps." // { default = true; }; }; }; @@ -19,7 +19,7 @@ in { backspace = "delete"; # Delete key on backspace. capslock = "overload(control, esc)"; # Ctrl/esc combo. compose = "layer(layer_number)"; # Number input layer. - esc = "${config.setting.sysctrl}"; # System controls. + esc = "${config.setting.sysctrl}"; # System controls. leftcontrol = "overload(layer_alternative, leftcontrol)"; # Alternative layer for home, end etc. rightcontrol = "layer(layer_control)"; # Media and other controls. rightshift = "backspace"; # Backspace. diff --git a/module/Ld.nix b/module/Ld.nix new file mode 100644 index 0000000..8005ce2 --- /dev/null +++ b/module/Ld.nix @@ -0,0 +1,67 @@ +{ pkgs, ... }: { + # This thing allow you to run ELF (binary) files just like in other distros. + # The only difference is that we need to specify their linking dependencies + # bellow in `libraries` section. + # programs.nix-ld = { + # enable = true; + # package = pkgs.nix-ld; + # libraries = with pkgs; [ + # # Add any missing dynamic libraries for unpackaged programs here, NOT in environment.systemPackages. + # alsa-lib + # at-spi2-atk + # at-spi2-core + # atk + # cairo + # cups + # curl + # dbus + # expat + # fontconfig + # fontconfig + # freetype + # freetype + # fuse3 + # gdk-pixbuf + # glib + # gtk3 + # icu + # libGL + # libappindicator-gtk3 + # libdrm + # libglvnd + # libglvnd + # libnotify + # libpulseaudio + # libunwind + # libusb1 + # libuuid + # libxkbcommon + # libxml2 + # mesa + # nspr + # nss + # openssl + # pango + # pipewire + # sqlite + # stdenv.cc.cc + # systemd + # vulkan-loader + # xorg.libX11 + # xorg.libXScrnSaver + # xorg.libXcomposite + # xorg.libXcursor + # xorg.libXdamage + # xorg.libXext + # xorg.libXfixes + # xorg.libXi + # xorg.libXrandr + # xorg.libXrender + # xorg.libXtst + # xorg.libxcb + # xorg.libxkbfile + # xorg.libxshmfence + # zlib + # ]; + # }; +} diff --git a/module/common/Locale.nix b/module/Locale.nix similarity index 100% rename from module/common/Locale.nix rename to module/Locale.nix diff --git a/module/common/Network.nix b/module/Network.nix similarity index 100% rename from module/common/Network.nix rename to module/Network.nix diff --git a/module/common/Nix.nix b/module/Nix.nix similarity index 80% rename from module/common/Nix.nix rename to module/Nix.nix index 35fc546..aac21bb 100644 --- a/module/common/Nix.nix +++ b/module/Nix.nix @@ -1,12 +1,4 @@ -{ pkgs, ... }: { - environment.variables = { - # Allow running of proprietary software. - NIXPKGS_ALLOW_UNFREE = "1"; - - # I use this env variable to get currently running architecture. - NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}"; - }; - +{ ... }: { # Allow installation of proprietary software. nixpkgs.config.allowUnfree = true; diff --git a/module/Ollama.nix b/module/Ollama.nix index e8fa3a2..e323a84 100644 --- a/module/Ollama.nix +++ b/module/Ollama.nix @@ -19,9 +19,6 @@ in { config = mkIf cfg.enable { environment = { - # Add Ollama CLI app. - systemPackages = with pkgs; [ ollama ]; - # Specify default model. variables.OLLAMA_MODEL = cfg.primaryModel; }; diff --git a/module/Package.nix b/module/Package.nix new file mode 100644 index 0000000..5f0a423 --- /dev/null +++ b/module/Package.nix @@ -0,0 +1,18 @@ +{ pkgs, __findFile, ... } @args: let + package = import args; +in { + environment.systemPackages = package.core; + + # Special packages. + programs = { + adb.enable = true; + git.enable = true; + java = { + enable = true; + package = pkgs.corretto21; + }; + }; + services = { + udisks2.enable = true; + }; +} diff --git a/module/desktop/Polkit.nix b/module/Polkit.nix similarity index 100% rename from module/desktop/Polkit.nix rename to module/Polkit.nix diff --git a/module/desktop/Portal.nix b/module/Portal.nix similarity index 100% rename from module/desktop/Portal.nix rename to module/Portal.nix diff --git a/module/desktop/Realtime.nix b/module/Realtime.nix similarity index 100% rename from module/desktop/Realtime.nix rename to module/Realtime.nix diff --git a/module/desktop/Sound.nix b/module/Sound.nix similarity index 72% rename from module/desktop/Sound.nix rename to module/Sound.nix index d0805b0..66a2d9e 100644 --- a/module/desktop/Sound.nix +++ b/module/Sound.nix @@ -10,10 +10,12 @@ in { hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; + enable = true; + pulse.enable = true; + alsa = { + enable = true; + support32Bit = true; + }; }; }; } diff --git a/module/common/Sshd.nix b/module/Sshd.nix similarity index 100% rename from module/common/Sshd.nix rename to module/Sshd.nix diff --git a/module/common/Swap.nix b/module/Swap.nix similarity index 100% rename from module/common/Swap.nix rename to module/Swap.nix diff --git a/module/Sway.nix b/module/Sway.nix new file mode 100644 index 0000000..ed5a574 --- /dev/null +++ b/module/Sway.nix @@ -0,0 +1,33 @@ +{ lib, config, ... } @args: with lib; let + cfg = config.module.desktop.sway; +in { + options = { + module.desktop.sway = { + enable = mkEnableOption "Use Sway WM."; + }; + }; + + config = mkIf cfg.enable { + module.desktop = { + app.common.enable = true; + bluetooth.enable = true; + brightness.enable = true; + portal.enable = true; + realtime.enable = true; + sound.enable = true; + wayland.enable = true; + }; + + services.gnome.gnome-keyring.enable = mkForce false; + environment.variables.XDG_CURRENT_DESKTOP = "sway"; + + programs.waybar.enable = true; + programs.sway = { + enable = true; + wrapperFeatures = { + base = true; + gtk = true; + }; + }; + }; +} diff --git a/module/Systemd.nix b/module/Systemd.nix new file mode 100644 index 0000000..b97c50d --- /dev/null +++ b/module/Systemd.nix @@ -0,0 +1,19 @@ +{ ... }: { + # HACK: Fix for broken tmpfiles setup for some services like PowerLimit. + systemd.timers.tmpfilesfix = { + timerConfig = { + OnBootSec = 5; + Unit = "systemd-tmpfiles-resetup.service"; + }; + wantedBy = [ "timers.target" ]; + }; + + # Systemd custom target for Sway. + systemd.user.targets.gui-session = { + after = [ "graphical-session-pre.target" ]; + bindsTo = [ "graphical-session.target" ]; + description = "GUI session."; + documentation = [ "man:systemd.special(7)" ]; + wants = [ "graphical-session-pre.target" ]; + }; +} diff --git a/module/Tablet.nix b/module/Tablet.nix index 7940167..10b3127 100644 --- a/module/Tablet.nix +++ b/module/Tablet.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: with lib; let +{ lib, config, ... }: with lib; let cfg = config.module.tablet; in { options = { @@ -7,8 +7,5 @@ in { config = mkIf cfg.enable { hardware.opentabletdriver.enable = true; - environment.systemPackages = with pkgs; [ - krita - ]; }; } diff --git a/module/common/Users.nix b/module/Users.nix similarity index 100% rename from module/common/Users.nix rename to module/Users.nix diff --git a/module/desktop/Wayland.nix b/module/Wayland.nix similarity index 100% rename from module/desktop/Wayland.nix rename to module/Wayland.nix diff --git a/module/common/Apks.nix b/module/common/Apks.nix deleted file mode 100644 index d43f779..0000000 --- a/module/common/Apks.nix +++ /dev/null @@ -1,17 +0,0 @@ -# I want to pull all the Apk files in their current state -# so that I always have an access to clients that match -# my service versions. -{ pkgs, lib, config, ... } @args: with lib; let - cfg = config.module.common.apks; - package = (pkgs.callPackage ./apks args); -in { - options = { - module.common.apks = { - enable = mkEnableOption "Android Apps Apk" // { default = true; }; - }; - }; - - config = mkIf cfg.enable { - environment.etc.apks.source = package; - }; -} diff --git a/module/common/Bash.nix b/module/common/Bash.nix deleted file mode 100644 index eb1d519..0000000 --- a/module/common/Bash.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib, util, pkgs, ... } @args: let - bash = import ./bash args; -in { - # Add my bash configuration to all *interactive* shells. - programs.bash.interactiveShellInit = bash.config; - - # Remove default aliases for `l`, `ll` etc as they break my function definitions. - environment.shellAliases = lib.mkForce {}; - - environment.variables = { - # Specify terminal mode. - TERM = "xterm-256color"; - }; -} diff --git a/module/common/Dotfiles.nix b/module/common/Dotfiles.nix deleted file mode 100644 index 7e287b5..0000000 --- a/module/common/Dotfiles.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ inputs, ... }: { - # Add a link for the active configuration to /etc/dotfiles. - environment.etc.dotfiles.source = inputs.self; -} diff --git a/module/common/Git.nix b/module/common/Git.nix deleted file mode 100644 index 0ba2c4b..0000000 --- a/module/common/Git.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ secret, ... }: { - programs.git = { - enable = true; - config = { - credential.helper = "store"; - init.defaultBranch = "main"; - pull.rebase = true; - push.autoSetupRemote = true; - rebase.autoStash = true; - user.signingkey = builtins.readFile secret.crypto.sign.git.key; - gpg.ssh.allowedSignersFile = toString secret.crypto.sign.git.allowed; - gpg.format = secret.crypto.sign.git.format; - }; - }; -} diff --git a/module/common/Ld.nix b/module/common/Ld.nix deleted file mode 100644 index 7914e8f..0000000 --- a/module/common/Ld.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs, ... }: { - # This thing allow you to run ELF (binary) files just like in other distros. - # The only difference is that we need to specify their linking dependencies - # bellow in `libraries` section. - programs.nix-ld = { - enable = true; - package = pkgs.nix-ld; - libraries = with pkgs; [ - # Add any missing dynamic libraries for unpackaged programs here, NOT in environment.systemPackages. - alsa-lib - at-spi2-atk - at-spi2-core - atk - cairo - cups - curl - dbus - expat - fontconfig - fontconfig - freetype - freetype - fuse3 - gdk-pixbuf - glib - gtk3 - icu - libGL - libappindicator-gtk3 - libdrm - libglvnd - libglvnd - libnotify - libpulseaudio - libunwind - libusb1 - libuuid - libxkbcommon - libxml2 - mesa - nspr - nss - openssl - pango - pipewire - sqlite - stdenv.cc.cc - systemd - vulkan-loader - xorg.libX11 - xorg.libXScrnSaver - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXtst - xorg.libxcb - xorg.libxkbfile - xorg.libxshmfence - zlib - ]; - }; -} diff --git a/module/common/Nvim.nix b/module/common/Nvim.nix deleted file mode 100644 index 4a616d3..0000000 --- a/module/common/Nvim.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ inputs, pkgs, util, key, config, ... } @args: let - nvim = import ./nvim args; -in { - environment = { - variables = { - EDITOR = "nvim"; # Use Nvim as a default editor. - MANPAGER = "nvim +Man!"; # Use Nvim to read man pages. - }; - systemPackages = with pkgs; [ - gcc # Required for Treesitter parsers. - ]; - }; - - programs.neovim = { - enable = true; - configure.customRC = nvim.config; - }; -} diff --git a/module/common/Package.nix b/module/common/Package.nix deleted file mode 100644 index 3bb71f2..0000000 --- a/module/common/Package.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ pkgs, ... }: { - # List of common packages I use. - environment.systemPackages = with pkgs; [ - binwalk # Can analyze files for other files inside them. - btop htop # System monitors. - coreutils # Common utilities. - cryptsetup # Filesystem encryption (LUKS). - curl # CLI http client. - ddrescue testdisk # Apps to recover data from drives. - diffutils # Diff tool. - dnsutils # Dns utilities like host. - exiftool # Image info. - fastfetch # Systeminfo summary. - ffmpeg # Video/audio converter. - file # Get general info about a file. - findutils # Find tool. - gcc # C compiler. - gdu # TUI storage analyzer. - git # Version control system. - gnumake gnused # GNU utils. - gparted parted # GUI/CLI disk partition tool. - imagemagick # Image converter and transformation tool. - inetutils # Things like FTP. - jq # Json parser. - lm_sensors # Hardware sensors, like temperature and fan speeds. - lshw # Detailed hardware info tool. - lsof # Find current file users. - ltex-ls # Latex LSP for neovim spellcheck. - man # App to read manuals. - nixd # Nix LSP. - nmap # Network analyzer. - parallel # Run programs in parallel. - pv # IO progress bar. - radare2 # Hex editor. - ripgrep # Grep for file search. - rsync # File copy tool. - scanmem # Memory edit tool. - smartmontools # S.M.A.R.T. tools. - sqlite # Serverless file-based database engine. - tree # Show directory stricture as a tree. - usbutils # Usb utilities like udiskctl. - utillinux # Common Linux utilities. - ventoy # Boot multiple ISO/images from a single USB stick. - wget # CLI http download tool. - wireguard-tools # Tools to work with Wireguard. - yazi chafa # CLI file manager. - zip unzip # Zip archive/unarchive tools. - - universal-android-debloater # Debloat Android devices. - ]; - - # Special packages. - programs = { - adb.enable = true; - java = { - enable = true; - package = pkgs.corretto21; - }; - }; - services = { - udisks2.enable = true; - }; -} diff --git a/module/common/Ssh.nix b/module/common/Ssh.nix deleted file mode 100644 index 877e0a8..0000000 --- a/module/common/Ssh.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, util, ... } @args: let - ssh = import ./ssh args; -in { - programs.ssh.extraConfig = ssh.config; - - # Add SSHFS to mount remote filesystems over SSH. - environment.systemPackages = with pkgs; [ sshfs ]; -} diff --git a/module/common/Systemd.nix b/module/common/Systemd.nix deleted file mode 100644 index 9aeaa84..0000000 --- a/module/common/Systemd.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: { - # HACK: Fix for broken tmpfiles setup for some services like PowerLimit. - systemd.timers.tmpfilesfix = { - timerConfig = { - OnBootSec = 5; - Unit = "systemd-tmpfiles-resetup.service"; - }; - wantedBy = [ "timers.target" ]; - }; -} diff --git a/module/common/Tmux.nix b/module/common/Tmux.nix deleted file mode 100644 index 4cf02e2..0000000 --- a/module/common/Tmux.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, util, ... } @args: let - tmux = import ./tmux args; -in { - programs.tmux = { - enable = true; - extraConfig = tmux.config; - }; -} diff --git a/module/common/YtDlp.nix b/module/common/YtDlp.nix deleted file mode 100644 index 191498a..0000000 --- a/module/common/YtDlp.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: { - # Instead of overlaying and rebuilding YtDlp I download the release from - # GitHub and patch it for Nix. - environment.systemPackages = with pkgs; [ - (pkgs.callPackage ./ytdlp {}) - ]; -} diff --git a/module/common/bash/default.nix b/module/common/bash/default.nix deleted file mode 100644 index 66ed743..0000000 --- a/module/common/bash/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, util, pkgs, ... } @args: let - modules = util.catText (util.ls ./module) args; - modulesFile = pkgs.writeText "bashModules" modules; -in { - inherit modules; - - config = modules + util.trimTabs ('' - # Find all functions. - function find_function() { - /usr/bin/env cat ${modulesFile} | /usr/bin/env grep "^function.*()" | /usr/bin/env sed -e "s/^function //" -e "s/().*//" - } - - # Export all functions. - export -f $(find_function | tr '\n' ' ') - export -f find_function - - # Autostart Sway. - if [[ -z $DISPLAY ]] && [[ "$(tty)" = "/dev/tty1" ]]; then - exec sway - fi - ''); -} diff --git a/module/common/tmux/default.nix b/module/common/tmux/default.nix deleted file mode 100644 index 3c9b53b..0000000 --- a/module/common/tmux/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ util, config, ... } @args: { - config = util.catText (util.ls ./module) args; -} diff --git a/module/desktop/App.nix b/module/desktop/App.nix deleted file mode 100644 index a1dcbf6..0000000 --- a/module/desktop/App.nix +++ /dev/null @@ -1,184 +0,0 @@ -{ pkgs, pkgsStable, pkgsMaster, config, lib, ... } @args: with lib; let - cfg = config.module.desktop.app; - - mangohud = import ./mangohud args; - firefox = import ./firefox args; -in { - options = { - module.desktop.app = { - common.enable = mkEnableOption "Common Apps."; - gaming.enable = mkEnableOption "Gaming Apps."; - creative.enable = mkEnableOption "Creative Apps."; - dev.enable = mkEnableOption "Dev Apps."; - extra.enable = mkEnableOption "Extra Apps."; - }; - }; - - config = mkMerge [ - # Common apps. - (mkIf cfg.common.enable { xdg.mime.defaultApplications = { - # Use `file -i file.txt` to find file mime type. - # Use `xdg-mime query default "text/plain"` to find default app. - "application/pdf" = "org.gnome.Evince.desktop"; - "application/vnd.openxmlformats-officedocument.*" = "onlyoffice-desktopeditors.desktop"; - "audio/*" = "mpv.desktop"; - "image/*" = "org.gnome.Loupe.desktop"; - "text/*" = "nvim.desktop"; - "video/*" = "mpv.desktop"; - }; - - environment = { - systemPackages = with pkgs; [ - appimage-run # Tool to run .AppImage files in NixOS. - evince # Document viewer. - foot # Terminal emulator. - gimp # Image manipulation program. - gnome.adwaita-icon-theme # GTK icons. - gnome.gnome-calculator # Calculator. - gnome.nautilus # File manager. - jellyfin-media-player # Jellyfin client (self-hosted Netflix). - loupe # Image viewer. - obs-studio # Streaming/recording app. - onlyoffice-bin # Office documents app suite. - - (mpv.override {scripts = [mpvScripts.mpris];}) # Media player. - ]; - - variables = { - # GTK apps compat. - GTK_CSD = 0; - - # Terminal settings. - TERM = "xterm-256color"; - TERMINAL = config.setting.terminal.bin; - - # Disable Firefox profile switching on rebuild. - MOZ_LEGACY_PROFILES = "1"; - }; - }; - - programs.firefox = let - mkExtension = install_url: { - inherit install_url; - installation_mode = "force_installed"; - }; - - mkBookmark = name: url: { inherit name url; }; - in { - enable = true; - package = pkgs.firefox-esr; - languagePacks = [ "en-US" "ru" ]; - autoConfig = firefox.config; - policies = { - ManagedBookmarks = [ - { toplevel_name = "Pin"; } - (mkBookmark "Dashboard" "https://home.voronind.com") - (mkBookmark "Music" "https://music.yandex.ru") - (mkBookmark "Telegram" "https://web.telegram.org/a") - (mkBookmark "Discord" "https://discord.com") - (mkBookmark "WorkMail" "https://mail.fsight.ru") - (mkBookmark "Git" "https://git.voronind.com") - (mkBookmark "WorkGit" "https://git.fmp.fsight.world") - (mkBookmark "WorkBoard" "https://support.fsight.ru") - (mkBookmark "Hass" "https://iot.voronind.com") - (mkBookmark "Cloud" "https://cloud.voronind.com") - ]; - ExtensionUpdate = true; - ExtensionSettings = { - # Block extension installation outside of this config. - "*" = { - install_sources = [ "*" ]; - installation_mode = "blocked"; - }; - "addon@darkreader.org" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; - "cliget@zaidabdulla.com" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/cliget/latest.xpi"; - "uBlock0@raymondhill.net" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; - "{d7742d87-e61d-4b78-b8a1-b469842139fa}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi"; - "{e7625f06-e252-479d-ac7a-db68aeaff2cb}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/togglefonts/latest.xpi"; - "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" = mkExtension "https://addons.mozilla.org/firefox/downloads/latest/user-agent-string-switcher/latest.xpi"; - # NOTE: This extension is helpful to find the required parameters for this config. - # Or find them yourself inside the `about:support`. - # "queryamoid@kaply.com" = mkExtension "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; - }; - # NOTE: `firefox-esr` edition is required to change default search engine. - SearchEngines = { - Default = "Searx"; - Add = [ - { - Alias = "s"; - Description = "Searx Search"; - IconURL = "https://search.voronind.com/favicon.ico"; - Method = "POST"; - Name = "Searx"; - PostData = "q={searchTerms}"; - # SuggestURLTemplate = "https://search.voronind.com/autocomplete?q={searchTerms}"; - URLTemplate = "https://search.voronind.com/search?q=%{searchTerms}"; - } - ]; - }; - }; - }; - }) - - # Gaming. - (mkIf cfg.gaming.enable { - hardware.graphics = let - packages = with pkgs; [ - dxvk - gamescope - pkgs.mangohud - vkd3d - ]; - in { - extraPackages = packages; - extraPackages32 = packages; - }; - - programs.steam.enable = true; - - environment = { - systemPackages = with pkgs; [ - steam-run - bottles dxvk gamescope pkgs.mangohud vkd3d wine64 # Gaming! - ]; - - variables = { - MANGOHUD = "1"; - MANGOHUD_CONFIGFILE = pkgs.writeText "MangoHudConfig" mangohud.config; - MANGOHUD_PRESETSFILE = pkgs.writeText "MangoHudPreset" mangohud.presets; - - WINEFSYNC = "1"; - }; - }; - }) - - # Creative. - (mkIf cfg.creative.enable { - environment.systemPackages = with pkgs; [ - aseprite # Pixel Art draw app. WARNING: Always builds from source. - blender-hip # Blender with HiP support. - krita # Draw! - ]; - }) - - # Development. - (mkIf cfg.dev.enable { - environment.systemPackages = with pkgs; [ - android-studio - jetbrains.idea-community - ]; - }) - - # Extras. - (mkIf cfg.extra.enable { - environment.systemPackages = with pkgs; [ - anilibria-winmaclinux # Anime! - blanket # Sounds generator. - calibre # Book library manager. - gnome.gnome-font-viewer # Font viewer. - tor-browser # Privacy browser. - ]; - }) - ]; -} diff --git a/module/desktop/Dconf.nix b/module/desktop/Dconf.nix deleted file mode 100644 index 0d8b814..0000000 --- a/module/desktop/Dconf.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ util, lib, config, ... } @args: with lib; let - cfg = config.module.desktop.dconf; - settings = util.catSet (util.ls ./dconf) args; -in { - options = { - module.desktop.dconf.enable = mkEnableOption "Dconf."; - }; - - config = mkIf cfg.enable { - # Gnome DE and GTK apps configuration. - programs.dconf.enable = true; - programs.dconf.profiles.user = { - enableUserDb = true; # Delete `~/.config/dconf/user` to reset user settings. - databases = [{ inherit settings; }]; - }; - }; -} diff --git a/module/desktop/Sway.nix b/module/desktop/Sway.nix deleted file mode 100644 index 0054f2b..0000000 --- a/module/desktop/Sway.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ pkgs, lib, config, ... } @args: with lib; let - cfg = config.module.desktop.sway; - - sway = import ./sway args; - swayconfig = pkgs.writeText "SwayConfig" sway.config; - swayscript = pkgs.writeShellScriptBin "swayscript" sway.script; -in { - options = { - module.desktop.sway = { - enable = mkEnableOption "Use Sway WM."; - }; - }; - - config = mkIf cfg.enable { - module.desktop = { - app.common.enable = true; - bluetooth.enable = true; - brightness.enable = true; - dconf.enable = true; - portal.enable = true; - realtime.enable = true; - sound.enable = true; - waybar.enable = true; - wayland.enable = true; - }; - - services.gnome.gnome-keyring.enable = mkForce false; - environment = { - systemPackages = with pkgs; [ - fuzzel # Application launcher. - grim slurp # Screenshot. - mako # Notification system. - networkmanagerapplet # Internet configuration. - pamixer pavucontrol pulseaudio # Audio. - playerctl # Multimedia controls. - swayscript # My custom Sway shell scripts. - ]; - - variables.XDG_CURRENT_DESKTOP = "sway"; - }; - - programs.sway = { - enable = true; - wrapperFeatures = { - base = true; - gtk = true; - }; - extraOptions = [ - "--config=${swayconfig}" - ]; - }; - }; -} diff --git a/module/desktop/Systemd.nix b/module/desktop/Systemd.nix deleted file mode 100644 index 7ae4b0a..0000000 --- a/module/desktop/Systemd.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, config, ... }: with lib; let - cfg = config.module.desktop.systemd; -in { - options = { - module.desktop.systemd.enable = mkEnableOption "Systemd Desktop config."; - }; - - config = mkIf cfg.enable { - # Systemd custom target for Sway. - systemd.user.targets.gui-session = { - after = [ "graphical-session-pre.target" ]; - bindsTo = [ "graphical-session.target" ]; - description = "GUI session."; - documentation = [ "man:systemd.special(7)" ]; - wants = [ "graphical-session-pre.target" ]; - }; - }; -} diff --git a/module/desktop/Waybar.nix b/module/desktop/Waybar.nix deleted file mode 100644 index 90cef25..0000000 --- a/module/desktop/Waybar.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, lib, config, ... } @args: with lib; let - cfg = config.module.desktop.waybar; - waybar = import ./waybar args; -in { - options = { - module.desktop.waybar.enable = mkEnableOption "Waybar."; - }; - - config = mkIf cfg.enable { - programs.waybar.enable = true; - - environment.variables = { - WAYBAR_CONFIG = waybar.config; - WAYBAR_STYLE = waybar.style; - }; - }; -} diff --git a/module/desktop/firefox/default.nix b/module/desktop/firefox/default.nix deleted file mode 100644 index dd4657e..0000000 --- a/module/desktop/firefox/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ util, config, ... }: { - config = util.trimTabs '' - // Bookmarks. - lockPref("browser.microsummary.enabled", true); - lockPref("browser.places.importBookmarksHTML", true); - lockPref("browser.toolbars.bookmarks.visibility", "never"); - - // Fonts. - pref("browser.display.use_document_fonts", 0); - lockPref("font.minimum-size.x-cyrillic", ${toString config.style.font.size.application}); - lockPref("font.minimum-size.x-unicode", ${toString config.style.font.size.application}); - lockPref("font.minimum-size.x-western", ${toString config.style.font.size.application}); - lockPref("font.name.monospace.x-cyrillic", "${config.style.font.monospace.name}"); - lockPref("font.name.monospace.x-unicode", "${config.style.font.monospace.name}"); - lockPref("font.name.monospace.x-western", "${config.style.font.monospace.name}"); - lockPref("font.name.sans-serif.x-cyrillic", "${config.style.font.sansSerif.name}"); - lockPref("font.name.sans-serif.x-unicode", "${config.style.font.sansSerif.name}"); - lockPref("font.name.sans-serif.x-western", "${config.style.font.sansSerif.name}"); - lockPref("font.name.serif.x-cyrillic", "${config.style.font.serif.name}"); - lockPref("font.name.serif.x-unicode", "${config.style.font.serif.name}"); - lockPref("font.name.serif.x-western", "${config.style.font.serif.name}"); - - // Animations. - lockPref("browser.fullscreen.animateUp", 0); - lockPref("browser.fullscreen.autohide", true); - - // Homepage. - lockPref("browser.newtabpage.enabled", false); - lockPref("browser.startup.homepage", "https://home.voronind.com/"); - lockPref("browser.startup.page", 3); - - // Passwords. - lockPref("signon.prefillForms", false); - lockPref("signon.rememberSignons", false); - - // Formats. - lockPref("image.jxl.enabled", true); - - // User agent. - // pref("general.useragent.override", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36"); - ''; -} diff --git a/module/common/apks/default.nix b/package/apks/default.nix similarity index 100% rename from module/common/apks/default.nix rename to package/apks/default.nix diff --git a/module/common/applefont/default.nix b/package/applefont/default.nix similarity index 97% rename from module/common/applefont/default.nix rename to package/applefont/default.nix index 6a07606..40c3ef3 100644 --- a/module/common/applefont/default.nix +++ b/package/applefont/default.nix @@ -51,7 +51,7 @@ in stdenv.mkDerivation { meta = with lib; { description = "Apple San Francisco, New York fonts."; homepage = "https://developer.apple.com/fonts"; - license = licenses.unfree; + license = licenses.mit; meta.platforms = platforms.all; }; } diff --git a/package/default.nix b/package/default.nix new file mode 100644 index 0000000..7e83680 --- /dev/null +++ b/package/default.nix @@ -0,0 +1,110 @@ +{ pkgs, pkgsStable, pkgsMaster, ... } @args: { + core = with pkgs; [ + android-tools # Android adb tool. Can be used to connect to itself via wireless debugging. + binwalk # Can analyze files for other files inside them. + btop htop # System monitors. + cryptsetup # Filesystem encryption (LUKS). + curl # CLI http client. + ddrescue testdisk # Apps to recover data from drives. + exiftool # Image info. + fastfetch # Systeminfo summary. + ffmpeg # Video/audio converter. + file # Get general info about a file. + gcc # C compiler. + gdu # TUI storage analyzer. + git # Version control system. + gnutar gzip xz # Archive and compression tools. + gparted parted # GUI/CLI disk partition tool. + imagemagick # Image converter and transformation tool. + inetutils # Things like FTP. + jq # Json parser. + lm_sensors # Hardware sensors, like temperature and fan speeds. + lshw # Detailed hardware info tool. + lsof # Find current file users. + ltex-ls # Latex LSP for neovim spellcheck. + man # App to read manuals. + neovim # Text editor. + nixd # Nix LSP. + nmap # Network analyzer. + ollama # LLMs. + openssh sshfs # Ssh client. + parallel # Run programs in parallel. + pv # IO progress bar. + radare2 # Hex editor. + ripgrep # Grep for file search. + rsync # File copy tool. + scanmem # Memory edit tool. + smartmontools # S.M.A.R.T. tools. + sqlite # Serverless file-based database engine. + tmux # Terminal multiplexor. + tree # Show directory stricture as a tree. + usbutils # Usb utilities like udiskctl. + utillinux # Common Linux utilities. + ventoy # Boot multiple ISO/images from a single USB stick. + wget # CLI http download tool. + wireguard-tools # Tools to work with Wireguard. + yazi chafa # CLI file manager. + zip unzip # Zip archive/unarchive tools. + + coreutils dnsutils diffutils findutils utillinux # Common utilities. + gawk gnused gnugrep gnumake ripgrep # Common Gnu utils. + + (pkgs.callPackage ./apks {}) + (pkgs.callPackage ./yamusicdownload {}) + (pkgs.callPackage ./ytdlp {}) + ]; + + desktop = with pkgs; [ + foot # Terminal emulator. + fuzzel # Application launcher. + grim slurp # Screenshot. + mako # Notification system. + networkmanagerapplet # Internet configuration. + pamixer pavucontrol pulseaudio # Audio. + playerctl # Multimedia controls. + sway waybar # Sway WM. + + (pkgs.callPackage ./swayscript args) + ]; + + common = with pkgs; [ + evince # Document viewer. + firefox-esr # Web browser. + gimp # Image manipulation program. + gnome.adwaita-icon-theme # GTK icons. + gnome.gnome-calculator # Calculator. + gnome.nautilus # File manager. + jellyfin-media-player # Jellyfin client (self-hosted Netflix). + loupe # Image viewer. + obs-studio # Streaming/recording app. + onlyoffice-bin # Office documents app suite. + + (mpv.override {scripts = [mpvScripts.mpris];}) # Media player. + ]; + + gaming = with pkgs; [ + steam-run # Run games outside of Steam. + steam bottles dxvk gamescope mangohud vkd3d wine64 # Gaming! + ]; + + creative = with pkgs; [ + aseprite # Pixel Art draw app. WARNING: Always builds from source. + blender-hip # Blender with HiP support. + krita # Draw! + ]; + + dev = with pkgs; [ + android-studio + jetbrains.idea-community + ]; + + extra = with pkgs; [ + anilibria-winmaclinux # Anime! + appimage-run # Tool to run .AppImage files in NixOS. + blanket # Sounds generator. + calibre # Book library manager. + gnome.gnome-font-viewer # Font viewer. + tor-browser # Privacy browser. + universal-android-debloater # Debloat Android devices. + ]; +} diff --git a/package/swayscript/default.nix b/package/swayscript/default.nix new file mode 100644 index 0000000..0168447 --- /dev/null +++ b/package/swayscript/default.nix @@ -0,0 +1,4 @@ +{ pkgs, util, ... } @args: + pkgs.writeShellScriptBin "swayscript" ( + util.catText (util.ls ./script) args + "\${@}" + ) diff --git a/module/desktop/sway/script/Monitor.nix b/package/swayscript/script/Monitor.nix similarity index 100% rename from module/desktop/sway/script/Monitor.nix rename to package/swayscript/script/Monitor.nix diff --git a/module/desktop/sway/script/Scratchpad.nix b/package/swayscript/script/Scratchpad.nix similarity index 100% rename from module/desktop/sway/script/Scratchpad.nix rename to package/swayscript/script/Scratchpad.nix diff --git a/module/desktop/sway/script/Sound.nix b/package/swayscript/script/Sound.nix similarity index 100% rename from module/desktop/sway/script/Sound.nix rename to package/swayscript/script/Sound.nix diff --git a/module/desktop/sway/script/Util.nix b/package/swayscript/script/Util.nix similarity index 100% rename from module/desktop/sway/script/Util.nix rename to package/swayscript/script/Util.nix diff --git a/module/desktop/sway/script/Vrr.nix b/package/swayscript/script/Vrr.nix similarity index 100% rename from module/desktop/sway/script/Vrr.nix rename to package/swayscript/script/Vrr.nix diff --git a/host/home/yamusicdownload/default.nix b/package/yamusicdownload/default.nix similarity index 90% rename from host/home/yamusicdownload/default.nix rename to package/yamusicdownload/default.nix index 25498fe..b41f7e8 100644 --- a/host/home/yamusicdownload/default.nix +++ b/package/yamusicdownload/default.nix @@ -17,4 +17,6 @@ rev = "08ea384869cbc31efb1e78b831e2356882219951"; hash = "sha256-WOFesD7HjskyqHaXZAPy3pgSPaEO+tOyQ+5MV3ZO7XU="; }; + + meta.mainProgram = "yandex-music-downloader"; } diff --git a/module/common/ytdlp/default.nix b/package/ytdlp/default.nix similarity index 96% rename from module/common/ytdlp/default.nix rename to package/ytdlp/default.nix index 4a3a63a..d315b7a 100644 --- a/module/common/ytdlp/default.nix +++ b/package/ytdlp/default.nix @@ -25,5 +25,6 @@ in stdenv.mkDerivation { homepage = "https://github.com/yt-dlp/yt-dlp"; license = licenses.unlicense; meta.platforms = platforms.all; + mainProgram = "yt-dlp"; }; } diff --git a/user/Root.nix b/user/Root.nix deleted file mode 100644 index 9116149..0000000 --- a/user/Root.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ secret, ... }: { - imports = [ ./common ]; - - user.common.users = [{ name = "root"; homeDir = "/root"; }]; - users.users.root.hashedPassword = secret.hashedPassword; - security.sudo = { - enable = false; - extraConfig = '' - Defaults rootpw - ''; - }; -} diff --git a/user/common/default.nix b/user/common/default.nix deleted file mode 100644 index ab2a090..0000000 --- a/user/common/default.nix +++ /dev/null @@ -1,90 +0,0 @@ -# This is a common user configuration. -{ const -, homeDir -, key -, pkgs -, secret -, config -, style -, username -, util -, lib -, ... } @args: with lib; let - cfg = config.user.common; - - # Configuration modules. - btop = import ./top/btop args; - editor = import ./editorconfig args; - foot = import ./foot args; - fuzzel = import ./fuzzel args; - gtk3 = import ./gtk/3 args; - htop = import ./top/htop args; - keyd = import ./keyd args; - mako = import ./mako args; - yazi = import ./yazi args; -in { - options = { - user.common.users = mkOption { - default = []; - type = types.listOf types.attrs; - }; - }; - - config = { - home-manager = { - users = builtins.foldl' (acc: user: acc // { - ${user.name} = { - home = { - username = user.name; - homeDirectory = user.homeDir; - stateVersion = const.stateVersion; - file = { - ".config/btop/btop.conf".text = btop.text; - ".config/foot/foot.ini".source = foot.file; - ".config/fuzzel/fuzzel.ini".source = fuzzel.file; - ".config/gtk-3.0/bookmarks".text = gtk3.bookmarks; - ".config/htop/htoprc".text = htop.text; - ".config/keyd/app.conf".text = keyd.text; - ".config/mako/config".source = mako.file; - ".config/yazi/init.lua".source = yazi.init; - ".config/yazi/keymap.toml".source = yazi.keymap; - ".config/yazi/theme.toml".source = yazi.theme; - ".config/yazi/yazi.toml".source = yazi.yazi; - ".editorconfig".source = editor.file; - ".parallel/will-cite".text = ""; - "media/template".source = ./template; - }; - }; - - xdg.userDirs = { - enable = true; - createDirectories = true; - desktop = "${user.homeDir}/"; - documents = "${user.homeDir}/document/"; - download = "${user.homeDir}/download/"; - music = "${user.homeDir}/media/music/"; - pictures = "${user.homeDir}/media/picture/"; - publicShare = "${user.homeDir}/media/share/"; - templates = "${user.homeDir}/media/template/"; - videos = "${user.homeDir}/media/video/"; - extraConfig = { - XDG_TMP_DIR = "${user.homeDir}/tmp/"; - }; - }; - - programs = { - home-manager.enable = true; - gpg = { - enable = true; - inherit (secret.crypto) publicKeys; - }; - }; - }; - }) {} cfg.users; - - # If file exists, rename it with a new extension. - backupFileExtension = "old"; - }; - }; -} -