diff options
66 files changed, 329 insertions, 544 deletions
diff --git a/config/alacritty/default.nix b/config/alacritty/default.nix deleted file mode 100644 index e9130245d568..000000000000 --- a/config/alacritty/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ configTools, alacritty }: - -configTools.addFlags alacritty "alacritty" ''--config-file ${./config.yml}'' diff --git a/config/firefox/default.nix b/config/firefox/default.nix deleted file mode 100644 index 8b2cd7fca661..000000000000 --- a/config/firefox/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ configTools, firefox }: - -configTools.setEnv firefox "firefox" { - XDG_DATA_HOME = "$HOME/state"; - XDG_CACHE_HOME = "$HOME/state/cache"; -} diff --git a/config/firefox/overlay.nix b/config/firefox/overlay.nix deleted file mode 100644 index 74ce8760c53f..000000000000 --- a/config/firefox/overlay.nix +++ /dev/null @@ -1,18 +0,0 @@ -self: super: - -{ - firefoxPackages = with super.firefoxPackages; - super.firefoxPackages // { - firefox = firefox.overrideAttrs ({ patches ? [], ... }: { - patches = patches ++ [ release/D6695.diff ]; - }); - - firefox-beta = firefox-beta.overrideAttrs ({ patches ? [], ... }: { - patches = patches ++ [ beta/D6695.diff ]; - }); - - firefox-nightly = firefox-nightly.overrideAttrs ({ patches ? [], ... }: { - patches = patches ++ [ nightly/D6695.diff ]; - }); - }; -} diff --git a/config/git/default.nix b/config/git/default.nix deleted file mode 100644 index bc7d5bbb276c..000000000000 --- a/config/git/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ configTools, git }: - -configTools.xdgConfig { - package = git; - executable = "git"; - path = "git/config"; - text = import ./config.nix; -} diff --git a/config/gnupg/default.nix b/config/gnupg/default.nix deleted file mode 100644 index a5a7b9b309c6..000000000000 --- a/config/gnupg/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ configTools, gnupg }: - -configTools.setEnv gnupg "gpg" { - GNUPGHOME = "$HOME/state/gnupg"; -} diff --git a/config/gnupg/module.nix b/config/gnupg/module.nix deleted file mode 100644 index d134443df70f..000000000000 --- a/config/gnupg/module.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, lib, ... }: - -let - inherit (pkgs) callPackage writeText; - inherit (lib) concatStringsSep mapAttrsToList; - - configs = { - "gpg.conf" = ./gpg.conf; - "gpg-agent.conf" = writeText "gpg-agent.conf" - (callPackage ./gpg-agent.conf.nix {}); - "dirmngr.conf" = ./dirmngr.conf; - }; - -in - { - home.qyliss.dirs."state/gnupg".activationScripts.config = '' - ${concatStringsSep "\n" (mapAttrsToList (name: path: '' - ln -sf ${path} ${name} - '') configs)} - ''; - - environment.systemPackages = with pkgs.pkgsConfigured; [ gnupg ]; - } diff --git a/config/isync/default.nix b/config/isync/default.nix deleted file mode 100644 index 481fe84d9b82..000000000000 --- a/config/isync/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ configTools, writeText, isync, gnupg }: - -let - mbsyncrc = writeText "mbsyncrc" (import ./mbsyncrc.nix { inherit gnupg; }); - -in - configTools.addFlags isync "mbsync" ''-c ${mbsyncrc}'' diff --git a/config/isync/imappass.gpg b/config/isync/imappass.gpg deleted file mode 100644 index b2e85358794a..000000000000 --- a/config/isync/imappass.gpg +++ /dev/null Binary files differdiff --git a/config/kakoune/default.nix b/config/kakoune/default.nix deleted file mode 100644 index aade2eca775f..000000000000 --- a/config/kakoune/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ configTools, kakoune, fzf, tmux }: - -let - kakrc = import ./kakrc.nix { inherit fzf tmux; }; - -in - configTools.xdgConfig { - package = kakoune; - executable = "kak"; - path = "kak/kakrc"; - text = kakrc; - } diff --git a/config/less/default.nix b/config/less/default.nix deleted file mode 100644 index 56970cdd43aa..000000000000 --- a/config/less/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ configTools, less }: - -configTools.setEnv less "less" { - LESS = "cRS"; # use whole terminal, color, don't wrap -} diff --git a/config/msmtp/default.nix b/config/msmtp/default.nix deleted file mode 100644 index 9f99b5f3a51f..000000000000 --- a/config/msmtp/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ configTools, stdenv, writeText, gnupg, msmtp }: - -let - msmtprc = writeText "msmtprc" (import ./msmtprc.nix { - inherit stdenv gnupg; - }); - -in - configTools.addFlags msmtp "msmtp" ''-C ${msmtprc}'' diff --git a/config/msmtp/smtppass.gpg b/config/msmtp/smtppass.gpg deleted file mode 100644 index e60289a26e14..000000000000 --- a/config/msmtp/smtppass.gpg +++ /dev/null Binary files differdiff --git a/config/neomutt/default.nix b/config/neomutt/default.nix deleted file mode 100644 index dfd70e68ad71..000000000000 --- a/config/neomutt/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ configTools, writeText, gnupg, msmtp, neomutt }: - -let - muttrc = writeText "muttrc" (import ./muttrc.nix { inherit gnupg msmtp; }); - -in - configTools.addFlags neomutt "neomutt" ''-F ${muttrc}'' diff --git a/config/neomutt/muttrc.nix b/config/neomutt/muttrc.nix deleted file mode 100644 index 0d32b8da7732..000000000000 --- a/config/neomutt/muttrc.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ gnupg, msmtp }: - -'' -color index red default ~P - -set auto_tag = yes -set beep = no -set beep_new = yes -set fast_reply = yes -set folder = ~/mail -set help = no -set mark_old = no -set pager = "less -+S" -set quit = ask-yes -set sort = threads -set sort_browser = new -set user_agent = no - -unset prompt_after - -set spoolfile = +INBOX - -# set sendmail = "${msmtp}/bin/msmtp -a work" -# set record = "=[Gmail]/Sent Mail" -# set postponed = "=[Gmail]/Drafts" -mailboxes =INBOX =Flats =Indirect =Roles =Services =Lists =Lists/GitHub =Lists/rust-users =Lists/libtool =Lists/Bugzilla =Lists/hacklab-members =Lists/edinburgh-ath =Drafts =Sent =Archive =Archive/Receipts =Trash =Spam -set record = "=Sent" -set trash = "=Archive" -set postponed = "=Drafts" -set sendmail = "${msmtp}/bin/msmtp -a personal" - -set pgp_use_gpg_agent = yes -set crypt_autosign = yes -set crypt_opportunistic_encrypt = yes -set postpone_encrypt = yes - -# Required for postpone_encrypt to work -set pgp_default_key = 757356D779BBB888773E415E736CCDF9EF51BD97 - -set pgp_decode_command = "${gnupg}/bin/gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - %f" -set pgp_verify_command = "${gnupg}/bin/gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" -set pgp_decrypt_command = "${gnupg}/bin/gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - --decrypt %f" -set pgp_sign_command = "${gnupg}/bin/gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --detach-sign %f" -set pgp_clearsign_command = "${gnupg}/bin/gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --clearsign %f" -set pgp_encrypt_only_command = "pgpewrap ${gnupg}/bin/gpg --trust-model always --batch --quiet --no-verbose --output - --textmode --armor --encrypt -- --recipient %r -- %f" -set pgp_encrypt_sign_command = "pgpewrap ${gnupg}/bin/gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --trust-model always --batch --quiet --no-verbose --textmode --output - %?a?--local-user %a? --armor --sign --encrypt -- --recipient %r -- %f" -set pgp_import_command = "${gnupg}/bin/gpg --no-verbose --import %f" -set pgp_export_command = "${gnupg}/bin/gpg --no-verbose --armor --export %r" -set pgp_verify_key_command = "${gnupg}/bin/gpg --verbose --batch --fingerprint --check-sigs %r" -set pgp_list_pubring_command = "${gnupg}/bin/gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r" -set pgp_list_secring_command = "${gnupg}/bin/gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r" -set pgp_good_sign = "^\\[GNUPG:\\] GOODSIG -set pgp_decryption_okay = "^\\[GNUPG:\\] DECRYPTION_OKAY" -'' diff --git a/config/sway/default.nix b/config/sway/default.nix deleted file mode 100644 index 939613222328..000000000000 --- a/config/sway/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ configTools, writeText, sway, rofi }: - -let - config = import ./config.nix { inherit sway rofi; }; - -in - configTools.addFlags sway "sway" ''-c ${writeText "sway-config" config}'' diff --git a/config/tmux/default.nix b/config/tmux/default.nix deleted file mode 100644 index af6723aa7349..000000000000 --- a/config/tmux/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ configTools, tmux -, stdenv, writeText, writeShellScriptBin -, coreutils, extract_url, reattach-to-user-namespace, ruby, zsh }: - -let - config = writeText "tmux.conf" (import ./config.nix { - inherit stdenv writeText writeShellScriptBin - coreutils extract_url reattach-to-user-namespace ruby tmux zsh; - }); - -in - configTools.addFlags tmux "tmux" ''-f ${config}'' diff --git a/config/tools.nix b/config/tools.nix deleted file mode 100644 index 5e26bafdda17..000000000000 --- a/config/tools.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, symlinkJoin, writeTextFile, writeShellScriptBin }: - -let - inherit (lib) concatStrings mapAttrsToList; - -in rec { - - configure = pkg: wrapped: - (symlinkJoin { - name = "${pkg.name}-configured"; - paths = [ wrapped pkg ]; - }).overrideAttrs (oldAttrs: { - passthru = pkg.passthru or {}; - }) // { - unconfigured = pkg; - }; - - addFlags = pkg: bin: flags: - configure pkg (writeShellScriptBin bin '' - exec ${pkg}/bin/${bin} ${flags} "$@" - ''); - - setEnv = pkg: bin: env: - configure pkg (writeShellScriptBin bin - ((concatStrings (mapAttrsToList - (name: value: "export ${name}=${value}\n") env)) + '' - exec ${pkg}/bin/${bin} "$@" - '') - ); - - xdgConfig = { package, executable, path, text }: - setEnv package executable { - XDG_CONFIG_HOME = writeTextFile { - name = "${package.name}-config"; - destination = "/${path}"; - inherit text; - }; - }; - -} diff --git a/config/weechat/default.nix b/config/weechat/default.nix deleted file mode 100644 index 1c6f800d7685..000000000000 --- a/config/weechat/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ configTools, weechat }: - -configTools.setEnv weechat "weechat" { - WEECHAT_HOME = "$HOME/state/weechat"; -} diff --git a/config/zsh/default.nix b/config/zsh/default.nix deleted file mode 100644 index 2c322ab6e928..000000000000 --- a/config/zsh/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ configTools, stdenv, lib, writeText, linkFarm, zsh -, coreutils, zsh-nix-shell, zsh-syntax-highlighting -, zsh-history-substring-search, zsh-autosuggestions -}: - -let - inherit (lib) mapAttrsToList; - - files = { - ".zshrc" = writeText "zshrc" (import ./zshrc.nix { - inherit stdenv lib coreutils zsh-nix-shell zsh-syntax-highlighting - zsh-history-substring-search zsh-autosuggestions; - }); - }; - -in - configTools.setEnv zsh "zsh" { - ZDOTDIR = linkFarm "zdotdir" - (mapAttrsToList (name: path: { inherit name path; }) files); - } diff --git a/config/zsh/module.nix b/config/zsh/module.nix deleted file mode 100644 index 6dc64f94097b..000000000000 --- a/config/zsh/module.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, ... }: - -{ - home.qyliss.dirs."state/zsh" = {}; - - environment.etc.zshrc.text = '' - unsetopt GLOBAL_RCS - - if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then - . ${config.system.build.setEnvironment} - fi - ''; -} diff --git a/config/zsh/zshenv.nix b/config/zsh/zshenv.nix deleted file mode 100644 index 2ddac9a385b6..000000000000 --- a/config/zsh/zshenv.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ setEnvironment }: - -'' -unsetopt GLOBAL_RCS - -if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then - . ${setEnvironment} -fi -'' diff --git a/modules/home/default.nix b/modules/home/default.nix index 0ad1cb85b255..780bac85b334 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -12,8 +12,8 @@ let type = nullOr str; }; group = mkOption { - default = "users"; - type = str; + default = null; + type = nullOr str; }; permissions = mkOption { default = "0700"; @@ -31,10 +31,12 @@ let owner = if dir.owner == null then user else config.users.users.${dir.owner}; + + group = if dir.group == null then owner.group else dir.group; in '' chmod ${dir.permissions} . - chown ${owner.name}:${dir.group} . + chown ${owner.name}:${group} . ${concatStringsSep "\n" (attrValues dir.activationScripts)} ''; diff --git a/modules/shell/default.nix b/modules/shell/default.nix index d26d1fb1edbc..1d2a5a58a0b1 100644 --- a/modules/shell/default.nix +++ b/modules/shell/default.nix @@ -1,19 +1,16 @@ { pkgs, ... }: { - imports = [ ../../config/zsh/module.nix ]; + imports = [ ./git ./kakoune ./less ./tmux ./zsh ]; - environment.systemPackages = with pkgs.pkgsConfigured; [ + environment.systemPackages = with pkgs; [ coreutils-prefixed curl fzf - gitSVN gnused gotop httpie jq - kakoune - less lynx moreutils ncdu @@ -24,7 +21,7 @@ pv ranger silver-searcher - tmux + traceroute tree units unixtools.watch @@ -32,8 +29,6 @@ whois ] ++ lib.optional stdenv.isDarwin pinentry_mac; - environment.shells = with pkgs.pkgsConfigured; [ zsh ]; - environment.variables.EDITOR = "kak"; environment.variables.EMAIL = "hi@alyssa.is"; } diff --git a/config/git/attributes b/modules/shell/git/attributes index 6f33cd4e46e9..6f33cd4e46e9 100644 --- a/config/git/attributes +++ b/modules/shell/git/attributes diff --git a/config/git/config.nix b/modules/shell/git/config.nix index 88fa7220fe4d..88fa7220fe4d 100644 --- a/config/git/config.nix +++ b/modules/shell/git/config.nix diff --git a/modules/shell/git/default.nix b/modules/shell/git/default.nix new file mode 100644 index 000000000000..56b7af620d4c --- /dev/null +++ b/modules/shell/git/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ gitSVN ]; + + xdg.config.users.qyliss.paths."git/config" = + pkgs.writeText "gitconfig" (import ./config.nix); +} diff --git a/config/git/ignore b/modules/shell/git/ignore index 412e6620e1af..412e6620e1af 100644 --- a/config/git/ignore +++ b/modules/shell/git/ignore diff --git a/config/kakoune/kakrc.nix b/modules/shell/kakoune/config.nix index 2168b37a6b26..2168b37a6b26 100644 --- a/config/kakoune/kakrc.nix +++ b/modules/shell/kakoune/config.nix diff --git a/modules/shell/kakoune/default.nix b/modules/shell/kakoune/default.nix new file mode 100644 index 000000000000..fa5cc9a704ed --- /dev/null +++ b/modules/shell/kakoune/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ kakoune ]; + + xdg.config.users.qyliss.paths."kak/kakrc" = + with pkgs; writeText "kakrc" (callPackage ./config.nix {}); +} diff --git a/modules/shell/less/default.nix b/modules/shell/less/default.nix new file mode 100644 index 000000000000..bf6637ee3a7e --- /dev/null +++ b/modules/shell/less/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ less ]; + + environment.variables.LESS = "cRS"; # use whole terminal, color, don't wrap +} diff --git a/config/tmux/config.nix b/modules/shell/tmux/config.nix index d62a472bc1d8..d62a472bc1d8 100644 --- a/config/tmux/config.nix +++ b/modules/shell/tmux/config.nix diff --git a/modules/shell/tmux/default.nix b/modules/shell/tmux/default.nix new file mode 100644 index 000000000000..469e53f89d01 --- /dev/null +++ b/modules/shell/tmux/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + xdg.config.users.qyliss.paths."tmux.conf" = + with pkgs; writeText "tmux.conf" (callPackage ./config.nix { }); + + environment.systemPackages = with pkgs; [ tmux ]; +} diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix new file mode 100644 index 000000000000..d151e1434eca --- /dev/null +++ b/modules/shell/zsh/default.nix @@ -0,0 +1,22 @@ +{ pkgs, config, ... }: + +{ + environment.etc.zshrc.text = '' + unsetopt GLOBAL_RCS + + if [ -z "$__NIXOS_SET_ENVIRONMENT_DONE" ]; then + . ${config.system.build.setEnvironment} + fi + ''; + + environment.extraInit = '' + export ZDOTDIR="/etc/xdg/nixos/per-user/$USER/zsh" + ''; + + home.qyliss.dirs."state/zsh" = {}; + + xdg.config.users.qyliss.paths."zsh/.zshrc" = + with pkgs; writeText "zshrc" (callPackage ./zshrc.nix {}); + + environment.systemPackages = with pkgs; [ zsh nix-zsh-completions ]; +} diff --git a/config/zsh/zshrc.nix b/modules/shell/zsh/zshrc.nix index a91236d900cb..a91236d900cb 100644 --- a/config/zsh/zshrc.nix +++ b/modules/shell/zsh/zshrc.nix diff --git a/modules/users/default.nix b/modules/users/default.nix index 7eda04536e2f..b1aa14ef6d70 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -9,21 +9,20 @@ in { imports = [ ../home ]; users.mutableUsers = false; + users.groups.qyliss = {}; users.users.qyliss = { createHome = true; home = mkDefault "/home"; uid = mkDefault 1000; - packages = with pkgs.pkgsConfigured; [ - git - kakoune - tmux - ]; - group = "users"; + group = "qyliss"; extraGroups = [ "wheel" "networkmanager" ]; - shell = pkgs.pkgsConfigured.zsh; + shell = pkgs.zsh; }; - home.qyliss.permissions = "0500"; + home.qyliss = { + permissions = "0550"; + group = "qyliss"; + }; home.qyliss.dirs.state = { permissions = "0500"; }; diff --git a/modules/workstation/default.nix b/modules/workstation/default.nix index d9a4860cc372..b18c3e46f180 100644 --- a/modules/workstation/default.nix +++ b/modules/workstation/default.nix @@ -4,7 +4,7 @@ imports = [ ../nix ../locale ../shell ../users ./windowing ./fonts ./yubikey ./hardware ./networking - ./mail ../../config/weechat/module.nix ../../config/gnupg/module.nix + ./gnupg ./mail ./weechat ]; environment.systemPackages = with pkgs; [ mosh ]; diff --git a/modules/workstation/gnupg/default.nix b/modules/workstation/gnupg/default.nix new file mode 100644 index 000000000000..ca59c18bed2c --- /dev/null +++ b/modules/workstation/gnupg/default.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + home.qyliss.dirs."state/gnupg".activationScripts.config = + let + gpg-agent-conf = with pkgs; + writeText "gpg-agent.conf" (callPackage ./gpg-agent.conf.nix {}); + in '' + ln -sf ${./dirmngr.conf} dirmngr.conf + ln -sf ${./gpg.conf} gpg.conf + ln -sf ${gpg-agent-conf} gpg-agent.conf + ''; + + environment.systemPackages = with pkgs; [ gnupg ]; + + environment.extraInit = '' + export GNUPGHOME="$HOME/state/gnupg" + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + ''; +} diff --git a/config/gnupg/dirmngr.conf b/modules/workstation/gnupg/dirmngr.conf index 9b7105671236..9b7105671236 100644 --- a/config/gnupg/dirmngr.conf +++ b/modules/workstation/gnupg/dirmngr.conf diff --git a/config/gnupg/gpg-agent.conf.nix b/modules/workstation/gnupg/gpg-agent.conf.nix index 36b2f196bfa4..36b2f196bfa4 100644 --- a/config/gnupg/gpg-agent.conf.nix +++ b/modules/workstation/gnupg/gpg-agent.conf.nix diff --git a/config/gnupg/gpg.conf b/modules/workstation/gnupg/gpg.conf index ec69a24559bb..ec69a24559bb 100644 --- a/config/gnupg/gpg.conf +++ b/modules/workstation/gnupg/gpg.conf diff --git a/modules/workstation/mail/default.nix b/modules/workstation/mail/default.nix index 9b14f2981ec8..75b471fd626a 100644 --- a/modules/workstation/mail/default.nix +++ b/modules/workstation/mail/default.nix @@ -1,7 +1,16 @@ { pkgs, ... }: { - imports = [ ./mutt ]; + imports = [ ./isync ./msmtp ./mutt ]; - environment.systemPackages = with pkgs.pkgsConfigured; [ isync ]; + users.users.qyliss-mail = { + home = "/var/home/qyliss-mail"; + group = "qyliss"; + createHome = true; + }; + + home.qyliss.dirs.mail = { + group = "qyliss"; + permissions = "0770"; + }; } diff --git a/modules/workstation/mail/isync/default.nix b/modules/workstation/mail/isync/default.nix index 66343a0c3625..1ec41d8e13c2 100644 --- a/modules/workstation/mail/isync/default.nix +++ b/modules/workstation/mail/isync/default.nix @@ -1,36 +1,30 @@ -{ pkgs, options, ... }: +{ pkgs, config, ... }: -let - inherit (pkgs.pkgsConfigured) isync; -in { - config = - if options.environment ? "darwinConfig" then - { - launchd.user.agents.isync = { - serviceConfig.ProgramArguments = [ "${isync}/bin/mbsync" "Periodic" ]; - serviceConfig.StartInterval = 300; - serviceConfig.RunAtLoad = true; - }; - } - else - { - systemd.user.services.isync = { - serviceConfig = { - Type = "oneshot"; - ExecStart = '' - ${isync}/bin/mbsync Periodic - ''; - }; - }; +{ + environment.systemPackages = with pkgs; [ isync ]; - systemd.user.timers.isync = { - timerConfig = { - Unit = "isync.service"; - OnCalendar = "*:0/5"; - Persistent = "true"; - }; - wantedBy = [ "default.target" ]; - }; + systemd.services.isync = + let + mbsyncrc = pkgs.writeText "mbsyncrc" (import ./mbsyncrc.nix { + maildir = "${config.users.users.qyliss.home}/mail"; + }); + in { + serviceConfig = { + Type = "oneshot"; + User = "qyliss-mail"; + ExecStart = '' + ${pkgs.isync}/bin/mbsync -a -c ${mbsyncrc} + ''; }; + }; + + systemd.timers.isync = { + timerConfig = { + Unit = "isync.service"; + OnCalendar = "*:0/5"; + Persistent = "true"; + }; + wantedBy = [ "multi-user.target" ]; + }; } diff --git a/config/isync/mbsyncrc.nix b/modules/workstation/mail/isync/mbsyncrc.nix index f714b97f0adf..3a093e35efb5 100644 --- a/config/isync/mbsyncrc.nix +++ b/modules/workstation/mail/isync/mbsyncrc.nix @@ -1,17 +1,17 @@ -{ gnupg }: +{ maildir }: '' Create Both MaildirStore local - Path ~/mail/ - Inbox ~/mail/INBOX + Path ${maildir}/ + Inbox ${maildir}/INBOX Subfolders Verbatim IMAPAccount fastmail Host imap.fastmail.com User alyssa@fastmail.com - PassCmd "${gnupg}/bin/gpg -d -q --no-tty ${./imappass.gpg}" + PassCmd "cat ~/imappass" SSLType IMAPS SSLVersions TLSv1.2 diff --git a/modules/workstation/mail/msmtp/default.nix b/modules/workstation/mail/msmtp/default.nix new file mode 100644 index 000000000000..e6dbaaa5ba86 --- /dev/null +++ b/modules/workstation/mail/msmtp/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ msmtp ]; + + home.qyliss.dirs."state/msmtp" = {}; + + xdg.config.users.qyliss.paths."msmtp/config" = + with pkgs; writeText "msmtprc" (callPackage ./msmtprc.nix {}); +} diff --git a/config/msmtp/msmtprc.nix b/modules/workstation/mail/msmtp/msmtprc.nix index 5320b27a470a..f4caa74565d7 100644 --- a/config/msmtp/msmtprc.nix +++ b/modules/workstation/mail/msmtp/msmtprc.nix @@ -20,5 +20,5 @@ port 465 tls_starttls off from hi@alyssa.is user alyssa@fastmail.com -passwordeval ${gnupg}/bin/gpg --no-tty -q -d ${./smtppass.gpg} +passwordeval ${gnupg}/bin/gpg --no-tty -q -d ~/state/msmtp/smtppass.gpg '' diff --git a/modules/workstation/mail/mutt/default.nix b/modules/workstation/mail/mutt/default.nix index 1aa8d2aa29d3..2a7e6fc250f4 100644 --- a/modules/workstation/mail/mutt/default.nix +++ b/modules/workstation/mail/mutt/default.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { - imports = [ ../../../shell ]; + environment.systemPackages = with pkgs; [ neomutt ]; - environment.systemPackages = with pkgs.pkgsConfigured; [ neomutt ]; + xdg.config.users.qyliss.paths."mutt/muttrc" = ./muttrc; } diff --git a/modules/workstation/mail/mutt/muttrc b/modules/workstation/mail/mutt/muttrc new file mode 100644 index 000000000000..97c4e99b3034 --- /dev/null +++ b/modules/workstation/mail/mutt/muttrc @@ -0,0 +1,50 @@ +color index red default ~P + +set auto_tag = yes +set beep = no +set beep_new = yes +set fast_reply = yes +set folder = ~/mail +set help = no +set mark_old = no +set pager = "less -+S" +set quit = ask-yes +set sort = threads +set sort_browser = new +set user_agent = no + +unset prompt_after + +set spoolfile = +INBOX + +# set sendmail = "msmtp -a work" +# set record = "=[Gmail]/Sent Mail" +# set postponed = "=[Gmail]/Drafts" +mailboxes =INBOX =Flats =Indirect =Roles =Services =Lists =Lists/GitHub =Lists/rust-users =Lists/libtool =Lists/Bugzilla =Lists/hacklab-members =Lists/edinburgh-ath =Drafts =Sent =Archive =Archive/Receipts =Trash =Spam +set record = "=Sent" +set trash = "=Archive" +set postponed = "=Drafts" +set sendmail = "msmtp -a personal" + +set pgp_use_gpg_agent = yes +set crypt_autosign = yes +set crypt_opportunistic_encrypt = yes +set postpone_encrypt = yes + +# Required for postpone_encrypt to work +set pgp_default_key = 757356D779BBB888773E415E736CCDF9EF51BD97 + +set pgp_decode_command = "gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - %f" +set pgp_verify_command = "gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" +set pgp_decrypt_command = "gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - --decrypt %f" +set pgp_sign_command = "gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --detach-sign %f" +set pgp_clearsign_command = "gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --clearsign %f" +set pgp_encrypt_only_command = "pgpewrap gpg --trust-model always --batch --quiet --no-verbose --output - --textmode --armor --encrypt -- --recipient %r -- %f" +set pgp_encrypt_sign_command = "pgpewrap gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --trust-model always --batch --quiet --no-verbose --textmode --output - %?a?--local-user %a? --armor --sign --encrypt -- --recipient %r -- %f" +set pgp_import_command = "gpg --no-verbose --import %f" +set pgp_export_command = "gpg --no-verbose --armor --export %r" +set pgp_verify_key_command = "gpg --verbose --batch --fingerprint --check-sigs %r" +set pgp_list_pubring_command = "gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r" +set pgp_list_secring_command = "gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r" +set pgp_good_sign = "^\\[GNUPG:\\] GOODSIG +set pgp_decryption_okay = "^\\[GNUPG:\\] DECRYPTION_OKAY" diff --git a/config/weechat/module.nix b/modules/workstation/weechat/default.nix index 439fe175ae83..4ea9ec0084d2 100644 --- a/config/weechat/module.nix +++ b/modules/workstation/weechat/default.nix @@ -1,12 +1,16 @@ { pkgs, ... }: { + environment.extraInit = '' + export WEECHAT_HOME="$HOME/state/weechat" + ''; + + environment.systemPackages = with pkgs; [ weechat ]; + home.qyliss.dirs."state/weechat".activationScripts.git = '' ${pkgs.git}/bin/git init -q ${pkgs.git}/bin/git remote rm origin 2>/dev/null || true ${pkgs.git}/bin/git remote add origin git@github.com:alyssais/weechat-config chown -R qyliss .git ''; - - environment.systemPackages = with pkgs.pkgsConfigured; [ weechat ]; } diff --git a/config/alacritty/config.yml b/modules/workstation/windowing/alacritty/config.yml index 8cef63fa7c33..8cef63fa7c33 100644 --- a/config/alacritty/config.yml +++ b/modules/workstation/windowing/alacritty/config.yml diff --git a/modules/workstation/windowing/alacritty/default.nix b/modules/workstation/windowing/alacritty/default.nix new file mode 100644 index 000000000000..bb3dc6982c99 --- /dev/null +++ b/modules/workstation/windowing/alacritty/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + imports = [ ../../../xdg ]; + + environment.systemPackages = with pkgs; + lib.optional (!stdenv.isDarwin) alacritty; + + xdg.config.users.qyliss.paths."alacritty/alacritty.yml" = ./config.yml; +} diff --git a/modules/workstation/windowing/default.nix b/modules/workstation/windowing/default.nix index e435fd42b68e..0ee51bf20e3c 100644 --- a/modules/workstation/windowing/default.nix +++ b/modules/workstation/windowing/default.nix @@ -1,12 +1,7 @@ -{ pkgs, lib, ... }: +{ pkgs, ... }: { - imports = [ ../../../config/firefox/module.nix ]; + imports = [ ./alacritty ./firefox ./sway ]; environment.variables.XKB_DEFAULT_LAYOUT = "dvorak"; - programs.sway-beta.enable = true; - programs.sway-beta.package = pkgs.pkgsConfigured.sway-beta; - - environment.systemPackages = with pkgs.pkgsConfigured; - lib.optionals (!stdenv.isDarwin) [ alacritty ]; } diff --git a/config/firefox/module.nix b/modules/workstation/windowing/firefox/default.nix index 9895ce87070d..5d363b55b7e8 100644 --- a/config/firefox/module.nix +++ b/modules/workstation/windowing/firefox/default.nix @@ -7,5 +7,5 @@ ln -sf ${./user.js} mozilla/firefox/default/user.js ''; - environment.systemPackages = with pkgs.pkgsConfigured; [ firefox ]; + environment.systemPackages = with pkgs; [ firefox ]; } diff --git a/config/firefox/profiles.ini b/modules/workstation/windowing/firefox/profiles.ini index becf53354e76..becf53354e76 100644 --- a/config/firefox/profiles.ini +++ b/modules/workstation/windowing/firefox/profiles.ini diff --git a/config/firefox/user.js b/modules/workstation/windowing/firefox/user.js index 8b137891791f..8b137891791f 100644 --- a/config/firefox/user.js +++ b/modules/workstation/windowing/firefox/user.js diff --git a/config/sway/config.nix b/modules/workstation/windowing/sway/config.nix index d1d6076ab25c..d1d6076ab25c 100644 --- a/config/sway/config.nix +++ b/modules/workstation/windowing/sway/config.nix diff --git a/modules/workstation/windowing/sway/default.nix b/modules/workstation/windowing/sway/default.nix new file mode 100644 index 000000000000..d3dc1daddc07 --- /dev/null +++ b/modules/workstation/windowing/sway/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + programs.sway-beta.enable = true; + + xdg.config.users.qyliss.paths."sway/config" = + with pkgs; writeText "sway-config" (callPackage ./config.nix {}); +} diff --git a/modules/xdg/default.nix b/modules/xdg/default.nix new file mode 100644 index 000000000000..d3a2d1235144 --- /dev/null +++ b/modules/xdg/default.nix @@ -0,0 +1,44 @@ +{ lib, pkgs, config, ... }: + +let + inherit (lib) mapAttrsToList mkOption; + inherit (lib.types) attrsOf path submodule; + inherit (pkgs) linkFarm; + +in + { + options = { + xdg.config.users = mkOption { + default = {}; + type = attrsOf (submodule ({ ... }: { + options = { + paths = mkOption { + default = {}; + type = attrsOf path; + }; + }; + })); + }; + }; + + config = { + environment.etc."xdg/nixos/per-user".source = + linkFarm "xdg-config-users" + (mapAttrsToList (user: { paths, ... }: { + name = user; + path = linkFarm "${user}-xdg-config-home" + (mapAttrsToList + (name: path: { inherit name path; }) + paths); + }) config.xdg.config.users); + + environment.extraInit = '' + etc_xdg_config_home=/run/current-system/etc/xdg/nixos/per-user/$USER + if [ -d "$etc_xdg_config_home" ]; then + export XDG_CONFIG_HOME="''${XDG_CONFIG_HOME-$etc_xdg_config_home}" + fi + export XDG_DATA_HOME="''${XDG_DATA_HOME-$HOME/state}" + export XDG_CACHE_HOME="''${XDG_DATA_HOME-$HOME/state/cache}" + ''; + }; + } diff --git a/nixpkgs-overlays/patches/default.nix b/nixpkgs-overlays/patches/default.nix index c81b49e75ff3..f1c81b0a1b0e 100644 --- a/nixpkgs-overlays/patches/default.nix +++ b/nixpkgs-overlays/patches/default.nix @@ -1,3 +1,9 @@ self: super: { + firefoxPackages = self.callPackage ./firefox/packages.nix { + inherit (super) firefoxPackages; + }; + neomutt = self.callPackage ./neomutt { inherit (super) neomutt; }; + + tmux = self.callPackage ./tmux { inherit (super) tmux; }; } diff --git a/config/firefox/beta/D6695.diff b/nixpkgs-overlays/patches/firefox/beta/D6695.diff index f8a8deeb8581..f8a8deeb8581 100644 --- a/config/firefox/beta/D6695.diff +++ b/nixpkgs-overlays/patches/firefox/beta/D6695.diff diff --git a/config/firefox/nightly/D6695.diff b/nixpkgs-overlays/patches/firefox/nightly/D6695.diff index 31a08471a8cc..31a08471a8cc 100644 --- a/config/firefox/nightly/D6695.diff +++ b/nixpkgs-overlays/patches/firefox/nightly/D6695.diff diff --git a/nixpkgs-overlays/patches/firefox/packages.nix b/nixpkgs-overlays/patches/firefox/packages.nix new file mode 100644 index 000000000000..aac5c2eb5c50 --- /dev/null +++ b/nixpkgs-overlays/patches/firefox/packages.nix @@ -0,0 +1,17 @@ +{ firefoxPackages }: + +with firefoxPackages; + +firefoxPackages // { + firefox = firefox.overrideAttrs ({ patches ? [], ... }: { + patches = patches ++ [ release/D6695.diff ]; + }); + + firefox-beta = firefox-beta.overrideAttrs ({ patches ? [], ... }: { + patches = patches ++ [ beta/D6695.diff ]; + }); + + firefox-nightly = firefox-nightly.overrideAttrs ({ patches ? [], ... }: { + patches = patches ++ [ nightly/D6695.diff ]; + }); +} diff --git a/nixpkgs-overlays/patches/firefox/profiles.ini b/nixpkgs-overlays/patches/firefox/profiles.ini new file mode 100644 index 000000000000..becf53354e76 --- /dev/null +++ b/nixpkgs-overlays/patches/firefox/profiles.ini @@ -0,0 +1,8 @@ +[General] +StartWithLastProfile=1 + +[Profile0] +Name=default +IsRelative=1 +Path=default +Default=1 diff --git a/config/firefox/release/D6695.diff b/nixpkgs-overlays/patches/firefox/release/D6695.diff index d15342ba50fa..f8a8deeb8581 100644 --- a/config/firefox/release/D6695.diff +++ b/nixpkgs-overlays/patches/firefox/release/D6695.diff @@ -1,5 +1,5 @@ diff --git a/toolkit/moz.build b/toolkit/moz.build -index 109fb2ce9..0b871d931 100644 +index 109fb2c..0b871d9 100644 --- a/toolkit/moz.build +++ b/toolkit/moz.build @@ -72,3 +72,5 @@ with Files('mozapps/preferences/**'): @@ -8,134 +8,11 @@ index 109fb2ce9..0b871d931 100644 +if CONFIG['ENABLE_TESTS']: + DIRS += ['tests/gtest'] -diff --git a/toolkit/tests/gtest/TestXREAppDir.cpp b/toolkit/tests/gtest/TestXREAppDir.cpp -new file mode 100644 -index 000000000..afa5f1b54 ---- /dev/null -+++ b/toolkit/tests/gtest/TestXREAppDir.cpp -@@ -0,0 +1,94 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim:set ts=2 sw=2 sts=2 et cindent: */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "nsXREDirProvider.h" -+#include "gtest/gtest.h" -+ -+#if defined(XP_UNIX) && !defined(XP_MACOSX) -+ -+#include <stdlib.h> -+#include <unistd.h> -+#include <sys/stat.h> -+ -+// Remove @path and all its subdirs. -+static void -+cleanup(std::string path) -+{ -+ nsresult rv; -+ nsCOMPtr<nsIFile> localDir; -+ rv = NS_NewNativeLocalFile( -+ nsDependentCString((char*)path.c_str()), true, getter_AddRefs(localDir)); -+ EXPECT_EQ(NS_OK, rv); -+ rv = localDir->Remove(true); -+ EXPECT_EQ(NS_OK, rv); -+} -+ -+// Create a temp dir and set HOME to it. -+// Upon successful completion, return the string with the path of the homedir. -+static std::string -+getNewHome() -+{ -+ char tmpHomedir[] = "/tmp/mozilla-tmp.XXXXXX"; -+ std::string homedir = mkdtemp(tmpHomedir); -+ EXPECT_EQ(0, setenv("HOME", (char*)homedir.c_str(), 1)); -+ return homedir; -+} -+ -+// Check if '$HOME/.mozilla' is used when it exists. -+TEST(toolkit_xre, LegacyAppUserDir) -+{ -+ nsCOMPtr<nsIFile> localDir; -+ nsresult rv; -+ nsAutoCString cwd; -+ std::string homedir = getNewHome(); -+ ASSERT_EQ(0, mkdir((char*)(homedir + "/.mozilla").c_str(), S_IRWXU)); -+ rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(localDir)); -+ ASSERT_EQ(NS_OK, rv); -+ localDir->GetNativePath(cwd); -+ std::string expectedAppDir = homedir + "/.mozilla/firefox"; -+ std::string appDir = cwd.get(); -+ ASSERT_EQ(expectedAppDir, appDir); -+ cleanup(homedir); -+} -+ -+// Check if '$HOME/.local/share/mozilla' is used -+// if $HOME/.mozilla does not exist and the env -+// variable XDG_DATA_HOME is not set. -+TEST(toolkit_xre, XDGDefaultAppUserDir) -+{ -+ nsCOMPtr<nsIFile> localDir; -+ nsresult rv; -+ nsAutoCString cwd; -+ std::string homedir = getNewHome(); -+ ASSERT_EQ(0, unsetenv("XDG_DATA_HOME")); -+ rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(localDir)); -+ ASSERT_EQ(NS_OK, rv); -+ localDir->GetNativePath(cwd); -+ std::string expectedAppDir = homedir + "/.local/share/mozilla/firefox"; -+ std::string appDir = cwd.get(); -+ ASSERT_EQ(expectedAppDir, appDir); -+ cleanup(homedir); -+} -+ -+// Check if '$XDG_DATA_HOME/mozilla' is -+// used if '$HOME/.mozilla' does not exist -+// and the env variable XDG_DATA_HOME is set. -+TEST(toolkit_xre, XDGAppUserDir) -+{ -+ nsCOMPtr<nsIFile> localDir; -+ nsresult rv; -+ nsAutoCString cwd; -+ std::string homedir = getNewHome(); -+ ASSERT_EQ(0, setenv("XDG_DATA_HOME", (char*)homedir.c_str(), 1)); -+ rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(localDir)); -+ ASSERT_EQ(NS_OK, rv); -+ localDir->GetNativePath(cwd); -+ std::string expectedAppDir = homedir + "/mozilla/firefox"; -+ std::string appDir = cwd.get(); -+ ASSERT_EQ(expectedAppDir, appDir); -+ cleanup(homedir); -+} -+#endif -diff --git a/toolkit/tests/gtest/moz.build b/toolkit/tests/gtest/moz.build -new file mode 100644 -index 000000000..4c1a10181 ---- /dev/null -+++ b/toolkit/tests/gtest/moz.build -@@ -0,0 +1,17 @@ -+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, you can obtain one at http://mozilla.org/MPL/2.0/. -+ -+Library('toolkit') -+ -+UNIFIED_SOURCES = [ -+ 'TestXREAppDir.cpp', -+] -+ -+LOCAL_INCLUDES += [ -+ '/toolkit/xre' -+] -+ -+FINAL_LIBRARY = 'xul-gtest' diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp -index 62da8de9b..164d7792e 100644 +index aafe82e..2d850fe 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp -@@ -421,13 +421,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, +@@ -390,13 +390,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, nsCOMPtr<nsIFile> localDir; rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), false); if (NS_SUCCEEDED(rv)) { @@ -149,8 +26,8 @@ index 62da8de9b..164d7792e 100644 localDir.swap(file); } } -@@ -1381,7 +1374,8 @@ nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult) - GetAppName())))) { +@@ -1238,7 +1231,8 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult, + nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) { return NS_ERROR_FAILURE; } - } else if (NS_FAILED(localDir->AppendNative(NS_LITERAL_CSTRING("Mozilla")))) { @@ -159,7 +36,7 @@ index 62da8de9b..164d7792e 100644 return NS_ERROR_FAILURE; } -@@ -1562,6 +1556,9 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal) +@@ -1367,6 +1361,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, NS_ENSURE_SUCCESS(rv, rv); localDir = dirFileMac; @@ -169,7 +46,7 @@ index 62da8de9b..164d7792e 100644 #elif defined(XP_IOS) nsAutoCString userDir; if (GetUIKitDirectory(aLocal, userDir)) { -@@ -1587,6 +1584,9 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal) +@@ -1390,6 +1387,9 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, NS_ENSURE_SUCCESS(rv, rv); rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir)); @@ -178,8 +55,8 @@ index 62da8de9b..164d7792e 100644 + NS_ENSURE_SUCCESS(rv, rv); #elif defined(XP_UNIX) const char* homeDir = getenv("HOME"); - if (!homeDir || !*homeDir) -@@ -1609,8 +1609,51 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal) + if (!homeDir || !*homeDir) return NS_ERROR_FAILURE; +@@ -1411,8 +1411,51 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache")); } } else { @@ -231,9 +108,9 @@ index 62da8de9b..164d7792e 100644 } #else #error "Don't know how to get product dir on your platform" -@@ -1734,20 +1777,12 @@ nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) +@@ -1523,20 +1566,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) { - #if defined (XP_MACOSX) || defined(XP_WIN) + #if defined(XP_MACOSX) || defined(XP_WIN) - static const char* const sXR = "Mozilla"; - rv = aFile->AppendNative(nsDependentCString(sXR)); @@ -252,9 +129,9 @@ index 62da8de9b..164d7792e 100644 static const char* const sExtensions = "extensions"; rv = aFile->AppendNative(nsDependentCString(sExtensions)); NS_ENSURE_SUCCESS(rv, rv); -@@ -1767,20 +1802,12 @@ nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) +@@ -1554,20 +1589,12 @@ nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) { - #if defined (XP_MACOSX) || defined(XP_WIN) + #if defined(XP_MACOSX) || defined(XP_WIN) - static const char* const sXR = "Mozilla"; - rv = aFile->AppendNative(nsDependentCString(sXR)); @@ -273,18 +150,17 @@ index 62da8de9b..164d7792e 100644 static const char* const sExtensions = "systemextensionsdev"; rv = aFile->AppendNative(nsDependentCString(sExtensions)); NS_ENSURE_SUCCESS(rv, rv); -@@ -1843,10 +1870,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) +@@ -1625,9 +1652,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) { NS_ENSURE_SUCCESS(rv, rv); #elif defined(XP_UNIX) nsAutoCString folder; - // Make it hidden (by starting with "."), except when local (the - // profile is already under ~/.cache or XDG_CACHE_HOME). -- if (!aLocal) -- folder.Assign('.'); +- if (!aLocal) folder.Assign('.'); if (!profile.IsEmpty()) { // Skip any leading path characters -@@ -1869,8 +1892,12 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) +@@ -1647,8 +1671,12 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) { folder.Append(vendor); ToLowerCase(folder); @@ -300,19 +176,19 @@ index 62da8de9b..164d7792e 100644 folder.Truncate(); } diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp -index 45628ed7a..dfe517c77 100644 +index 90e4ec9..8b838ec 100644 --- a/xpcom/io/nsAppFileLocationProvider.cpp +++ b/xpcom/io/nsAppFileLocationProvider.cpp -@@ -252,7 +252,7 @@ nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) - //---------------------------------------------------------------------------------------- - // GetProductDirectory - Gets the directory which contains the application data folder +@@ -247,7 +247,7 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) { + // GetProductDirectory - Gets the directory which contains the application data + // folder // -// UNIX : ~/.mozilla/ +// UNIX : ~/.mozilla/ or ${XDG_DATA_HOME:-~/.local/share}/mozilla // WIN : <Application Data folder on user's machine>\Mozilla // Mac : :Documents:Mozilla: //---------------------------------------------------------------------------------------- -@@ -297,19 +297,80 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, +@@ -291,19 +291,80 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, return rv; } #elif defined(XP_UNIX) @@ -394,9 +270,9 @@ index 45628ed7a..dfe517c77 100644 rv = localDir->Exists(&exists); if (NS_SUCCEEDED(rv) && !exists) { -@@ -329,7 +390,7 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, - //---------------------------------------------------------------------------------------- - // GetDefaultUserProfileRoot - Gets the directory which contains each user profile dir +@@ -323,7 +384,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile, + // GetDefaultUserProfileRoot - Gets the directory which contains each user + // profile dir // -// UNIX : ~/.mozilla/ +// UNIX : ~/.mozilla/ or ${XDG_DATA_HOME:-~/.local/share}/mozilla diff --git a/nixpkgs-overlays/patches/firefox/user.js b/nixpkgs-overlays/patches/firefox/user.js new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/nixpkgs-overlays/patches/firefox/user.js @@ -0,0 +1 @@ + diff --git a/nixpkgs-overlays/patches/tmux/default.nix b/nixpkgs-overlays/patches/tmux/default.nix new file mode 100644 index 000000000000..54ad974cef3c --- /dev/null +++ b/nixpkgs-overlays/patches/tmux/default.nix @@ -0,0 +1,10 @@ +{ fetchpatch, tmux }: + +tmux.overrideAttrs ({ patches ? [], ... }: { + patches = patches ++ [ + (fetchpatch { + url = https://github.com/tmux/tmux/pull/1144.patch; + sha256 = "0zg1q2n23vfiiwi5l54k8kn7k2p1xdh11cw7pyzjl44jpqzqwvaq"; + }) + ]; +}) diff --git a/nixpkgs-overlays/zzzzzz-config/default.nix b/nixpkgs-overlays/zzzzzz-config/default.nix deleted file mode 100644 index b3613ef154da..000000000000 --- a/nixpkgs-overlays/zzzzzz-config/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -# HACK: This directory is named zzzzzz-config.nix, because the config -# overlay should always be applied last. - -self: super: - -let - defaultOverlays = map import [ - ../../config/firefox/overlay.nix - ]; - - # Create another package set to avoid leaking configTools. - pkgsWithConfigTools = super.extend (self: super: { - configTools = super.callPackage ../../config/tools.nix { }; - }); - - # Use callPackage from pkgsWithConfigTools so that configured packages - # don't depend on other configured packages by default. - inherit (pkgsWithConfigTools) callPackage; - - inherit (super.lib) foldl; - -in - (foldl (a: e: a // e) {} (map (f: f self super) defaultOverlays)) // { - pkgsConfigured = pkgsWithConfigTools // rec { - alacritty = callPackage ../../config/alacritty { }; - - firefox = callPackage ../../config/firefox { }; - firefox-nightly = callPackage ../../config/firefox { firefox = super.firefox-nightly; }; - firefox-beta = callPackage ../../config/firefox { firefox = super.firefox-beta; }; - firefox-esr-52 = callPackage ../../config/firefox { firefox = super.firefox-esr-52; }; - firefox-esr-60 = callPackage ../../config/firefox { firefox = super.firefox-esr-60; }; - firefox-esr = callPackage ../../config/firefox { firefox = super.firefox-esr; }; - - gitAndTools = super.gitAndTools // { - git = callPackage ../../config/git { inherit (super.gitAndTools) git; }; - gitFull = callPackage ../../config/git { git = super.gitAndTools.gitFull; }; - gitSVN = callPackage ../../config/git { git = super.gitAndTools.gitSVN; }; - }; - inherit (gitAndTools) git gitFull gitSVN; - gitMinimal = callPackage ../../config/git { git = super.gitMinimal; }; - - gnupg = callPackage ../../config/gnupg { }; - - isync = callPackage ../../config/isync { inherit gnupg; }; - - kakoune = callPackage ../../config/kakoune { }; - - less = callPackage ../../config/less { }; - - msmtp = callPackage ../../config/msmtp { inherit gnupg; }; - - neomutt = callPackage ../../config/neomutt { inherit gnupg msmtp; }; - - sway = callPackage ../../config/sway { }; - sway-beta = callPackage ../../config/sway { sway = super.sway-beta; }; - - tmux = callPackage ../../config/tmux { }; - - weechat = callPackage ../../config/weechat { }; - - zsh = callPackage ../../config/zsh { }; - }; - } |