├── .gitignore ├── LICENSE ├── README.md ├── desktop ├── candidates │ ├── budgie.nix │ ├── cinnamon.nix │ ├── gnome.nix │ ├── labwc.nix │ ├── lxqt.nix │ ├── mate.nix │ ├── pantheon.nix │ └── xfce.nix ├── default.nix ├── fcitx.nix ├── firefox.nix ├── fonts-minimal.nix ├── fonts.nix ├── packages.nix ├── patches │ ├── elementary-terminal-ctrl-k.patch │ ├── xfce4-screensaver-mega.patch │ └── xfwm4-title-center.patch └── pkgs │ ├── dingtalk │ ├── default.nix │ ├── dingtalk.desktop │ ├── dingtalk.png │ └── harfbuzz.nix │ ├── libreoffice-icon-fixed.nix │ └── mate-menu.nix ├── flake.lock ├── flake.nix ├── helper ├── __internal-update-common.sh ├── gh-hosts-generator.cpp ├── nix-daemon-proxy.sh ├── non-xfce-autostart.sh ├── test-gnome.sh └── xfce-autostart.sh ├── machines ├── iso │ └── default.nix └── laptop │ ├── boot.nix │ ├── default.nix │ ├── hardware.nix │ ├── nixconfig.nix │ └── scripts.nix ├── packages.nix ├── profiles.nix ├── system ├── default.nix ├── git.nix ├── lamp.nix ├── locale.nix ├── misc.nix ├── network.nix ├── nixconfig.nix ├── packages.nix ├── python.nix ├── registry.json ├── virtualisation.nix └── zsh.nix └── users ├── bobby285271 └── default.nix └── misc └── default.nix /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | gh-hosts-generator.out 3 | result 4 | result-* 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2024 Bobby Rong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 这个仓库存着我正在用的 NixOS 配置文件,这里可能确实挺简陋的,大家随便看看就好。 2 | -------------------------------------------------------------------------------- /desktop/candidates/budgie.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | environment.sessionVariables."G_SLICE" = "always-malloc"; 5 | 6 | services = { 7 | xserver = { 8 | enable = true; 9 | xkb.layout = "us"; 10 | desktopManager.budgie = { 11 | enable = true; 12 | extraPlugins = [ 13 | # pkgs.budgie-analogue-clock-applet 14 | # pkgs.budgie-user-indicator-redux 15 | # pkgs.budgie-media-player-applet 16 | ]; 17 | extraGSettingsOverrides = '' 18 | [org.gnome.desktop.interface:Budgie] 19 | gtk-theme="Qogir-Light" 20 | # icon-theme="Tela" 21 | # cursor-theme="Adwaita" 22 | ''; 23 | }; 24 | displayManager = { 25 | lightdm = { 26 | background = "/var/lib/wallpaper/bobby285271/current.jpg"; 27 | greeters.slick = { 28 | enable = true; 29 | theme.name = "Qogir-Dark"; 30 | iconTheme.name = "Qogir"; 31 | cursorTheme.name = "Qogir"; 32 | draw-user-backgrounds = false; 33 | extraConfig = '' 34 | enable-hidpi = on 35 | ''; 36 | }; 37 | }; 38 | }; 39 | }; 40 | flatpak.enable = true; 41 | }; 42 | 43 | xdg.portal = { 44 | enable = true; 45 | extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; 46 | }; 47 | 48 | programs.gnome-terminal.enable = true; 49 | 50 | environment = { 51 | systemPackages = with pkgs; [ 52 | networkmanagerapplet 53 | # orchis-theme 54 | # tela-icon-theme 55 | ]; 56 | budgie.excludePackages = [ pkgs.mate.mate-terminal ]; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /desktop/candidates/cinnamon.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | services = { 5 | xserver = { 6 | enable = true; 7 | xkb.layout = "us"; 8 | desktopManager.cinnamon.enable = true; 9 | displayManager.lightdm = { 10 | background = "/var/lib/wallpaper/bobby285271/current.jpg"; 11 | greeters.slick = { 12 | # theme.name = "Mint-Y-Sand"; 13 | # iconTheme.name = "Mint-Y-Sand"; 14 | draw-user-backgrounds = false; 15 | extraConfig = '' 16 | enable-hidpi = on 17 | ''; 18 | }; 19 | }; 20 | }; 21 | flatpak.enable = true; 22 | }; 23 | 24 | xdg.portal = { 25 | enable = true; 26 | # extraPortals = [ 27 | # (pkgs.xdg-desktop-portal-gtk.override { 28 | # # Use the upstream default so this won't conflict with the xapp portal. 29 | # # buildPortalsInGnome = false; 30 | # }) 31 | # ]; 32 | }; 33 | 34 | # services.redshift.enable = true; 35 | 36 | nixpkgs.overlays = [ 37 | (self: super: { 38 | # gnome = super.gnome.overrideScope (pself: psuper: { 39 | # gnome-terminal = psuper.gnome-terminal.overrideAttrs (oldAttrs: { 40 | # patches = (oldAttrs.patches or [ ]) ++ [ 41 | # # Restore transparency 42 | # # https://git.launchpad.net/ubuntu/+source/gnome-terminal/refs/ 43 | # (super.fetchpatch { 44 | # url = "https://git.launchpad.net/ubuntu/+source/gnome-terminal/plain/debian/patches/0001-Restore-transparency.patch?h=import/3.44.1-1ubuntu1"; 45 | # hash = "sha256-WjQd+IFu0dj1dqoKByWpi9hQFek73ae0NCuwm9YRm4o="; 46 | # }) 47 | # ]; 48 | # }); 49 | # }); 50 | 51 | # python310 = super.python310.override { 52 | # packageOverrides = pyself: pysuper: { 53 | # pygobject3 = pysuper.pygobject3.overrideAttrs (_: { 54 | # src = pkgs.fetchFromGitLab { 55 | # domain = "gitlab.gnome.org"; 56 | # owner = "GNOME"; 57 | # repo = "pygobject"; 58 | # rev = "3.46.0"; 59 | # sha256 = "sha256-WdUmi5gZcHz+y10kxVSlefj5VlyIv7K8KpILZFiE+FY="; 60 | # }; 61 | # }); 62 | # }; 63 | # }; 64 | 65 | # cinnamon = super.cinnamon.overrideScope (pself: psuper: { 66 | # nemo-with-extensions = psuper.nemo-with-extensions.override { useDefaultExtensions = false; }; 67 | # }); 68 | }) 69 | ]; 70 | 71 | # system.replaceDependencies.replacements = 72 | # let 73 | # pygobject3 = pkgs.python310.pkgs.pygobject3.overrideAttrs (_: { 74 | # src = pkgs.fetchFromGitLab { 75 | # domain = "gitlab.gnome.org"; 76 | # owner = "GNOME"; 77 | # repo = "pygobject"; 78 | # rev = "fbbeb9d92bf98f21b5f419a182079a007e6ee6b6"; 79 | # sha256 = "sha256-dh0BdNaAS1pZj6fkVmS9lIplJenTDrzY8apM3PlW0E4="; 80 | # }; 81 | # }); 82 | # in 83 | # ( 84 | # (builtins.map 85 | # (output: { 86 | # original = pkgs.python310.pkgs.pygobject3.${output}; 87 | # replacement = pygobject3.${output}; 88 | # }) [ "out" "dev" ]) 89 | # ); 90 | 91 | services.geoclue2.enable = true; 92 | 93 | environment.systemPackages = with pkgs; [ 94 | # colloid-gtk-theme 95 | # colloid-icon-theme 96 | ]; 97 | } 98 | -------------------------------------------------------------------------------- /desktop/candidates/gnome.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services = { 5 | xserver = { 6 | enable = true; 7 | xkb.layout = "us"; 8 | desktopManager.gnome = { 9 | enable = true; 10 | flashback.enableMetacity = true; 11 | }; 12 | displayManager.gdm.enable = true; 13 | }; 14 | flatpak.enable = true; 15 | fwupd.enable = true; 16 | }; 17 | 18 | # programs.gnome-terminal.enable = true; 19 | # services.telepathy.enable = true; 20 | 21 | # xdg.portal.config = { 22 | # gnome = { 23 | # "default" = [ "gnome" "gtk" ]; 24 | # }; 25 | # x-cinnamon = { 26 | # "default" = [ "xapp" "gtk" ]; 27 | # }; 28 | # pantheon = { 29 | # "default" = [ "pantheon" "gtk" ]; 30 | # "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; 31 | # }; 32 | # common = { 33 | # "default" = [ "gtk" ]; 34 | # }; 35 | # }; 36 | 37 | # programs.gpaste.enable = true; 38 | xdg.portal.enable = true; 39 | 40 | # system.replaceDependencies.replacements = 41 | # let 42 | # cairo = pkgs.callPackage ./cairo.nix { }; 43 | # in 44 | # ( 45 | # (builtins.map 46 | # (output: { 47 | # original = pkgs.cairo.${output}; 48 | # replacement = cairo.${output}; 49 | # }) [ "out" "dev" ]) 50 | # ); 51 | } 52 | -------------------------------------------------------------------------------- /desktop/candidates/labwc.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.labwc.enable = true; 5 | 6 | services.xserver = { 7 | enable = true; 8 | desktopManager.xfce = { 9 | enable = true; 10 | noDesktop = true; 11 | enableXfwm = false; 12 | enableScreensaver = false; 13 | }; 14 | }; 15 | 16 | environment.systemPackages = with pkgs; [ 17 | bemenu 18 | labwc-tweaks 19 | labwc-gtktheme 20 | labwc-menu-generator 21 | mako 22 | sfwbar 23 | swaybg 24 | swayidle 25 | swaylock 26 | kanshi 27 | xfce.xfce4-terminal 28 | networkmanagerapplet 29 | adwaita-icon-theme 30 | greybird 31 | elementary-xfce-icon-theme 32 | glib 33 | ]; 34 | } 35 | -------------------------------------------------------------------------------- /desktop/candidates/lxqt.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | lightdm-scale-wrapper = pkgs.writeShellScript "lightdm-scale-wrapper" '' 5 | export GDK_SCALE=2 6 | export GDK_DPI_SCALE=1 7 | exec $@ 8 | ''; 9 | in 10 | 11 | { 12 | services = { 13 | xserver = { 14 | enable = true; 15 | xkb.layout = "us"; 16 | # desktopManager.xfce = { 17 | # enable = true; 18 | # enableWaylandSession = true; 19 | # # waylandSessionCompositor = "wayfire"; 20 | # }; 21 | desktopManager.lxqt.enable = true; 22 | displayManager = { 23 | lightdm = { 24 | background = "/var/lib/wallpaper/bobby285271/current.jpg"; 25 | extraSeatDefaults = '' 26 | greeter-wrapper = ${lightdm-scale-wrapper} 27 | ''; 28 | greeters.gtk = { 29 | enable = true; 30 | extraConfig = '' 31 | user-background = false 32 | cursor-theme-size = 48 33 | ''; 34 | theme.name = "Greybird"; 35 | iconTheme.name = "elementary-xfce"; 36 | indicators = [ 37 | "~host" 38 | "~spacer" 39 | "~session" 40 | "~language" 41 | "~a11y" 42 | "~clock" 43 | "~power" 44 | ]; 45 | clock-format = "%a, %b %d, %H:%M"; 46 | }; 47 | }; 48 | }; 49 | }; 50 | # displayManager.defaultSession = "xfce"; 51 | flatpak.enable = true; 52 | gnome.gnome-keyring.enable = true; 53 | }; 54 | 55 | xdg.portal = { 56 | enable = true; 57 | extraPortals = [ 58 | # pkgs.xdg-desktop-portal-gtk 59 | # pkgs.xdg-desktop-portal-xapp 60 | ]; 61 | }; 62 | 63 | environment = { 64 | sessionVariables = { 65 | # QT_SCALE_FACTOR = "2"; 66 | # GDK_DPI_SCALE = "0.5"; 67 | # QT_FONT_DPI = "96"; 68 | }; 69 | 70 | # systemPackages = with pkgs; [ 71 | # networkmanagerapplet 72 | # greybird 73 | # elementary-xfce-icon-theme 74 | # xfce.xfce4-clipman-plugin 75 | # xfce.xfce4-pulseaudio-plugin 76 | # xfce.xfce4-whiskermenu-plugin 77 | # mate.engrampa 78 | # # cinnamon.xapp 79 | # # file 80 | # # xfce.xfmpc 81 | # vala-language-server 82 | # ]; 83 | }; 84 | 85 | # programs = { 86 | # thunar.plugins = with pkgs.xfce; [ 87 | # thunar-archive-plugin 88 | # thunar-media-tags-plugin 89 | # thunar-volman 90 | # ]; 91 | # nm-applet = { 92 | # enable = true; 93 | # indicator = true; 94 | # }; 95 | # wayfire = { 96 | # enable = true; 97 | # plugins = with pkgs.wayfirePlugins; [ 98 | # wcm 99 | # wayfire-plugins-extra 100 | # ]; 101 | # }; 102 | # }; 103 | 104 | hardware.bluetooth.enable = true; 105 | 106 | # nixpkgs.overlays = [ 107 | # (self: super: { 108 | # xfce = super.xfce.overrideScope ( 109 | # pself: psuper: { 110 | # xfwm4 = psuper.xfwm4.overrideAttrs (oldAttrs: { 111 | # patches = (oldAttrs.patches or [ ]) ++ [ 112 | # # https://gitlab.xfce.org/xfce/xfwm4/-/merge_requests/27 113 | # ../patches/xfwm4-title-center.patch 114 | # ]; 115 | # }); 116 | # xfce4-screensaver = psuper.xfce4-screensaver.overrideAttrs (oldAttrs: { 117 | # # patches = (oldAttrs.patches or [ ]) ++ [ ../patches/xfce4-screensaver-mega.patch ]; 118 | # }); 119 | # } 120 | # ); 121 | # }) 122 | # ]; 123 | } 124 | -------------------------------------------------------------------------------- /desktop/candidates/mate.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services = { 5 | xserver = { 6 | enable = true; 7 | xkb.layout = "us"; 8 | desktopManager.mate.enableWaylandSession = true; 9 | displayManager.sddm.enable = true; 10 | }; 11 | flatpak.enable = true; 12 | accounts-daemon.enable = true; 13 | udisks2.enable = true; 14 | }; 15 | 16 | programs.wayfire.plugins = with pkgs.wayfirePlugins; [ 17 | firedecor 18 | wf-shell 19 | ]; 20 | 21 | nixpkgs.overlays = [ 22 | (self: super: { 23 | mate = super.mate.overrideScope ( 24 | pself: psuper: { 25 | # mate-terminal = psuper.mate-terminal.overrideAttrs (oldAttrs: { 26 | # patches = (oldAttrs.patches or [ ]) ++ [ 27 | # # Dark style 28 | # (super.fetchurl { 29 | # url = "https://jihulab.com/bobby285271/mate-patches/-/raw/8b43598992aa452dc9045fe4d6bb959a06a8bdbb/mate-terminal-dark-style.patch"; 30 | # sha256 = "1dj73in8bh90kwcd25hdizbwhljsq9i3g5zzj0iybw59lkvzfkjv"; 31 | # }) 32 | # ]; 33 | # }); 34 | 35 | # mate-control-center = psuper.mate-control-center.overrideAttrs (oldAttrs: { 36 | # patches = (oldAttrs.patches or [ ]) ++ [ 37 | # # Mint theme support 38 | # (super.fetchurl { 39 | # url = "https://jihulab.com/bobby285271/mate-patches/-/raw/8b43598992aa452dc9045fe4d6bb959a06a8bdbb/mate-control-center-metacity-3-support.patch"; 40 | # sha256 = "1nhqa3q53af4fnv8ya5ffa20i9z543av4q86y7ak7f462rgga3zp"; 41 | # }) 42 | # ]; 43 | # }); 44 | } 45 | ); 46 | }) 47 | ]; 48 | 49 | xdg.portal = { 50 | enable = true; 51 | extraPortals = [ 52 | (pkgs.xdg-desktop-portal-gtk.override { 53 | # Use the upstream default so this won't conflict with the xapp portal. 54 | # buildPortalsInGnome = false; 55 | }) 56 | # pkgs.xdg-desktop-portal-xapp 57 | ]; 58 | }; 59 | 60 | system.replaceDependencies.replacements = 61 | let 62 | libxml2_test = pkgs.libxml2.overrideAttrs (_: { 63 | version = "2.13.8"; 64 | src = pkgs.fetchurl { 65 | url = "mirror://gnome/sources/libxml2/2.13/libxml2-2.13.8.tar.xz"; 66 | hash = "sha256-J3KUyzMRmrcbK8gfL0Rem8lDW4k60VuyzSsOhZoO6Eo="; 67 | }; 68 | }); 69 | in 70 | ( 71 | (builtins.map 72 | (output: { 73 | oldDependency = pkgs.libxml2.${output}; 74 | newDependency = libxml2_test.${output}; 75 | }) 76 | [ 77 | "bin" 78 | "dev" 79 | "out" 80 | "devdoc" 81 | ] 82 | ) 83 | ); 84 | 85 | environment.systemPackages = with pkgs; [ 86 | # elementary-xfce-icon-theme 87 | networkmanagerapplet 88 | zenity 89 | # qogir-icon-theme 90 | # matcha-gtk-theme 91 | ]; 92 | } 93 | -------------------------------------------------------------------------------- /desktop/candidates/pantheon.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services = { 5 | xserver = { 6 | enable = true; 7 | xkb.layout = "us"; 8 | desktopManager.pantheon = { 9 | enable = true; 10 | debug = true; 11 | # extraSwitchboardPlugs = [ pkgs.pantheon-tweaks ]; 12 | }; 13 | }; 14 | flatpak.enable = true; 15 | }; 16 | 17 | environment.systemPackages = with pkgs; [ pantheon-tweaks ]; 18 | 19 | xdg.portal = { 20 | enable = true; 21 | extraPortals = [ 22 | (pkgs.xdg-desktop-portal-gtk.override { 23 | # Use the upstream default so this won't conflict with the pantheon portal. 24 | # buildPortalsInGnome = false; 25 | }) 26 | ]; 27 | }; 28 | 29 | # services.xserver.desktopManager.pantheon.extraWingpanelIndicators = with pkgs; [ wingpanel-indicator-namarupa ]; 30 | 31 | systemd.user.services.indicatorapp = { 32 | description = "indicator-application-gtk3"; 33 | wantedBy = [ "graphical-session.target" ]; 34 | partOf = [ "graphical-session.target" ]; 35 | serviceConfig = { 36 | ExecStart = "${pkgs.indicator-application-gtk3}/libexec/indicator-application/indicator-application-service"; 37 | }; 38 | }; 39 | 40 | # programs.pantheon-tweaks.enable = true; 41 | 42 | # system.replaceDependencies.replacements = 43 | # let 44 | # glib = pkgs.glib.overrideAttrs (old: { 45 | # mesonFlags = old.mesonFlags ++ [ "-Dglib_debug=disabled" ]; 46 | # }); 47 | # in 48 | # ( 49 | # (builtins.map 50 | # (output: { 51 | # original = pkgs.glib.${output}; 52 | # replacement = glib.${output}; 53 | # }) 54 | # [ 55 | # "bin" 56 | # "out" 57 | # "dev" 58 | # ] 59 | # ) 60 | # ); 61 | 62 | nixpkgs.overlays = [ 63 | (self: super: { 64 | pantheon = super.pantheon.overrideScope ( 65 | pself: psuper: { 66 | # elementary-notifications = psuper.elementary-notifications.overrideAttrs (oldAttrs: { 67 | # # I prefer the bubbles never automatically disappear. 68 | # prePatch = '' 69 | # substituteInPlace src/Bubble.vala \ 70 | # --replace "start_timeout" "// start_timeout" 71 | # ''; 72 | # }); 73 | 74 | # elementary-mail = psuper.elementary-mail.overrideAttrs (oldAttrs: { 75 | # # I do this for some well-known reasons (TM) 76 | # prePatch = '' 77 | # substituteInPlace src/MessageList/MessageListItem.vala \ 78 | # --replace "avatar.set_loadable_icon" "// avatar.set_loadable_icon" 79 | # ''; 80 | 81 | # separateDebugInfo = true; 82 | # }); 83 | 84 | elementary-terminal = psuper.elementary-terminal.overrideAttrs (oldAttrs: { 85 | patches = (oldAttrs.patches or [ ]) ++ [ 86 | # ../patches/elementary-terminal-ctrl-k.patch 87 | ]; 88 | }); 89 | 90 | # wingpanel = psuper.wingpanel.overrideAttrs (oldAttrs: { 91 | # # I prefer this 92 | # prePatch = '' 93 | # substituteInPlace wingpanel-interface/BackgroundManager.vala \ 94 | # --replace "new_state = BackgroundState.TRANSLUCENT_DARK;" "new_state = BackgroundState.TRANSLUCENT_LIGHT;" 95 | # ''; 96 | # }); 97 | } 98 | ); 99 | }) 100 | ]; 101 | } 102 | -------------------------------------------------------------------------------- /desktop/candidates/xfce.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | lightdm-scale-wrapper = pkgs.writeShellScript "lightdm-scale-wrapper" '' 5 | export GDK_SCALE=2 6 | export GDK_DPI_SCALE=1 7 | exec $@ 8 | ''; 9 | in 10 | 11 | { 12 | services = { 13 | xserver = { 14 | enable = true; 15 | xkb.layout = "us"; 16 | desktopManager.xfce = { 17 | enable = true; 18 | enableWaylandSession = true; 19 | # waylandSessionCompositor = "wayfire"; 20 | }; 21 | displayManager = { 22 | lightdm = { 23 | background = "#202020"; 24 | extraSeatDefaults = '' 25 | greeter-wrapper = ${lightdm-scale-wrapper} 26 | ''; 27 | greeters.gtk = { 28 | enable = true; 29 | extraConfig = '' 30 | user-background = false 31 | cursor-theme-size = 48 32 | ''; 33 | theme.name = "Greybird"; 34 | iconTheme.name = "elementary-xfce-hidpi"; 35 | indicators = [ 36 | "~host" 37 | "~spacer" 38 | "~session" 39 | "~language" 40 | "~a11y" 41 | "~clock" 42 | "~power" 43 | ]; 44 | clock-format = "%a, %b %d, %H:%M"; 45 | }; 46 | }; 47 | }; 48 | }; 49 | displayManager.defaultSession = "xfce"; 50 | flatpak.enable = true; 51 | gnome.gnome-keyring.enable = true; 52 | }; 53 | 54 | xdg.portal = { 55 | enable = true; 56 | extraPortals = [ 57 | pkgs.xdg-desktop-portal-gtk 58 | # pkgs.xdg-desktop-portal-xapp 59 | ]; 60 | }; 61 | 62 | environment = { 63 | sessionVariables = { 64 | QT_SCALE_FACTOR = "2"; 65 | # GDK_DPI_SCALE = "0.5"; 66 | # QT_FONT_DPI = "96"; 67 | }; 68 | 69 | systemPackages = with pkgs; [ 70 | networkmanagerapplet 71 | greybird 72 | elementary-xfce-icon-theme 73 | xfce.xfce4-clipman-plugin 74 | xfce.xfce4-pulseaudio-plugin 75 | xfce.xfce4-whiskermenu-plugin 76 | mate.engrampa 77 | # cinnamon.xapp 78 | # file 79 | # xfce.xfmpc 80 | vala-language-server 81 | ]; 82 | }; 83 | 84 | programs = { 85 | thunar.plugins = with pkgs.xfce; [ 86 | thunar-archive-plugin 87 | thunar-media-tags-plugin 88 | thunar-volman 89 | ]; 90 | nm-applet = { 91 | enable = true; 92 | indicator = true; 93 | }; 94 | wayfire = { 95 | enable = true; 96 | plugins = with pkgs.wayfirePlugins; [ 97 | wcm 98 | wayfire-plugins-extra 99 | ]; 100 | }; 101 | }; 102 | 103 | hardware.bluetooth.enable = true; 104 | 105 | nixpkgs.overlays = [ 106 | (self: super: { 107 | xfce = super.xfce.overrideScope ( 108 | pself: psuper: { 109 | xfwm4 = psuper.xfwm4.overrideAttrs (oldAttrs: { 110 | patches = (oldAttrs.patches or [ ]) ++ [ 111 | # https://gitlab.xfce.org/xfce/xfwm4/-/merge_requests/27 112 | ../patches/xfwm4-title-center.patch 113 | ]; 114 | }); 115 | xfce4-screensaver = psuper.xfce4-screensaver.overrideAttrs (oldAttrs: { 116 | # patches = (oldAttrs.patches or [ ]) ++ [ ../patches/xfce4-screensaver-mega.patch ]; 117 | }); 118 | } 119 | ); 120 | }) 121 | ]; 122 | } 123 | -------------------------------------------------------------------------------- /desktop/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | let 4 | folder = ./.; 5 | toImport = name: value: folder + ("/" + name); 6 | filterConfig = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; 7 | imports = lib.mapAttrsToList toImport (lib.filterAttrs filterConfig (builtins.readDir folder)); 8 | in 9 | { 10 | inherit imports; 11 | } 12 | -------------------------------------------------------------------------------- /desktop/fcitx.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | i18n.inputMethod = { 5 | enable = true; 6 | type = "fcitx5"; 7 | fcitx5.addons = [ pkgs.libsForQt5.fcitx5-chinese-addons ]; 8 | # fcitx5.addons = [ pkgs.fcitx5-chinese-addons ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /desktop/firefox.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs.firefox = { 5 | enable = true; 6 | languagePacks = [ "zh-CN" ]; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /desktop/fonts-minimal.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | fonts.packages = with pkgs; [ 5 | wqy_microhei 6 | wqy_zenhei 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /desktop/fonts.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | fonts = { 5 | enableDefaultPackages = true; 6 | fontconfig = { 7 | enable = true; 8 | defaultFonts = { 9 | emoji = [ "Noto Color Emoji" ]; 10 | monospace = [ 11 | "Hack" 12 | "Source Han Mono SC" 13 | ]; 14 | sansSerif = [ 15 | "Inter" 16 | "Liberation Sans" 17 | "Source Han Sans SC" 18 | ]; 19 | serif = [ 20 | "Liberation Serif" 21 | "Source Han Serif SC" 22 | ]; 23 | }; 24 | }; 25 | fontDir.enable = true; 26 | enableGhostscriptFonts = true; 27 | packages = with pkgs; [ 28 | hack-font 29 | inter 30 | liberation_ttf 31 | # noto-fonts-emoji 32 | noto-fonts-color-emoji 33 | roboto 34 | # sarasa-gothic 35 | source-han-mono 36 | source-han-sans 37 | source-han-serif 38 | ]; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /desktop/packages.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | let 4 | in 5 | # libreoffice-icon-fixed = pkgs.callPackage ./pkgs/libreoffice-icon-fixed.nix { }; 6 | # dingtalk = pkgs.callPackage ./pkgs/dingtalk { }; 7 | { 8 | environment.systemPackages = with pkgs; [ 9 | chromium 10 | # terminate called after throwing an instance of 'std::bad_alloc' 11 | # dingtalk 12 | drawing 13 | # firefox 14 | gitg 15 | gnome-boxes 16 | libreoffice-fresh 17 | # slack 18 | thunderbird 19 | vscode-fhs 20 | # vscodium-fhs 21 | timeshift 22 | ]; 23 | 24 | # system.replaceDependencies.replacements = 25 | # let 26 | # # Report all the crashes *downstream* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7836 27 | # gtk4-test = pkgs.gtk4.overrideAttrs (oldAttrs: { 28 | # patches = (oldAttrs.patches or [ ]) ++ [ 29 | # (pkgs.fetchpatch { 30 | # url = "https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7836.diff"; 31 | # hash = "sha256-AwsqnjzkHW0qf/7PUUjrUAUIwmbeq2pvoq1LhCu7tw0="; 32 | # }) 33 | # ]; 34 | # }); 35 | # in 36 | # (builtins.map 37 | # (output: { 38 | # original = pkgs.gtk4.${output}; 39 | # replacement = gtk4-test.${output}; 40 | # }) 41 | # [ 42 | # "out" 43 | # "dev" 44 | # "devdoc" 45 | # ] 46 | # ); 47 | } 48 | -------------------------------------------------------------------------------- /desktop/patches/elementary-terminal-ctrl-k.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/MainWindow.vala b/src/MainWindow.vala 2 | index 83e56964..98bad705 100644 3 | --- a/src/MainWindow.vala 4 | +++ b/src/MainWindow.vala 5 | @@ -191,7 +191,6 @@ namespace Terminal { 6 | _("Reset"), 7 | TerminalWidget.ACTION_RESET 8 | ); 9 | - reset_menuitem.set_attribute_value ("accel", new Variant ("s", TerminalWidget.ACCELS_RESET[0])); 10 | 11 | var paste_menuitem = new MenuItem ( 12 | _("Paste"), 13 | diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala 14 | index dee54455..6551b130 100644 15 | --- a/src/Widgets/TerminalWidget.vala 16 | +++ b/src/Widgets/TerminalWidget.vala 17 | @@ -447,11 +447,6 @@ namespace Terminal { 18 | } 19 | } 20 | 21 | - if (CONTROL_MASK in modifiers && match_keycode (Gdk.Key.k, keycode)) { 22 | - action_reset (); 23 | - return true; 24 | - } 25 | - 26 | if (CONTROL_MASK in modifiers && match_keycode (Gdk.Key.l, keycode)) { 27 | action_clear_screen (); 28 | return true; 29 | -------------------------------------------------------------------------------- /desktop/patches/xfce4-screensaver-mega.patch: -------------------------------------------------------------------------------- 1 | diff --git a/.gitignore b/.gitignore 2 | index 11264cb..29bbf14 100644 3 | --- a/.gitignore 4 | +++ b/.gitignore 5 | @@ -19,7 +19,6 @@ xfce4-screensaver-*/ 6 | *.pot 7 | *.tgz 8 | *.xz 9 | -*intltool* 10 | *marshal.c 11 | *marshal.h 12 | *~ 13 | @@ -27,6 +26,7 @@ config.* 14 | stamp-* 15 | 16 | # File Match 17 | +ABOUT-NLS 18 | ChangeLog 19 | compile 20 | configure 21 | @@ -47,6 +47,15 @@ data/xfce4-screensaver.pc 22 | data/xfce4-screensavers.menu 23 | doc/xfce4-screensaver.xml 24 | po/Makefile.in.in 25 | +po/Makevars.template 26 | +po/Rules-quot 27 | +po/boldquot.sed 28 | +po/en@boldquot.header 29 | +po/en@quot.header 30 | +po/insert-header.sin 31 | +po/quot.sed 32 | +po/remove-potcdate.sed 33 | +po/remove-potcdate.sin 34 | savers/*.desktop.in 35 | savers/floaters 36 | savers/popsquares 37 | diff --git a/Makefile.am b/Makefile.am 38 | index fe87266..aa74d35 100644 39 | --- a/Makefile.am 40 | +++ b/Makefile.am 41 | @@ -9,9 +9,9 @@ DISTCHECK_CONFIGURE_FLAGS = \ 42 | SUBDIRS = \ 43 | src \ 44 | savers \ 45 | - po \ 46 | data \ 47 | doc \ 48 | + po \ 49 | $(NULL) 50 | 51 | EXTRA_DIST = \ 52 | @@ -21,25 +21,12 @@ EXTRA_DIST = \ 53 | COPYING.LGPL \ 54 | AUTHORS \ 55 | INSTALL \ 56 | - README.md \ 57 | ChangeLog \ 58 | NEWS \ 59 | - intltool-extract.in \ 60 | - intltool-merge.in \ 61 | - intltool-update.in \ 62 | - $(NULL) 63 | - 64 | -DISTCLEANFILES = \ 65 | - intltool-extract \ 66 | - intltool-merge \ 67 | - intltool-update \ 68 | - ./po/.intltool-merge-cache \ 69 | - ./po/.intltool-merge-cache.lock \ 70 | $(NULL) 71 | 72 | MAINTAINERCLEANFILES = \ 73 | *~ \ 74 | - intltool-*.in \ 75 | compile \ 76 | configure \ 77 | INSTALL \ 78 | diff --git a/configure.ac b/configure.ac 79 | index 984eace..105411f 100644 80 | --- a/configure.ac 81 | +++ b/configure.ac 82 | @@ -23,7 +23,6 @@ dnl Silence warning: `ar: 'u' modifier ignored since 'D' is the default` 83 | dnl SEE https://www.mail-archive.com/automake-patches@gnu.org/msg07705.html 84 | AC_SUBST(AR_FLAGS, [cr]) 85 | 86 | -IT_PROG_INTLTOOL([0.50.1]) 87 | AC_PROG_CC 88 | AM_PROG_CC_C_O 89 | AC_CANONICAL_HOST 90 | @@ -36,9 +35,12 @@ AC_SUBST(VERSION) 91 | # Save flags to aclocal 92 | ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" 93 | 94 | -GETTEXT_PACKAGE=xfce4-screensaver 95 | -AC_SUBST(GETTEXT_PACKAGE) 96 | -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain]) 97 | +GETTEXT_PACKAGE="$PACKAGE" 98 | +AC_SUBST([GETTEXT_PACKAGE]) 99 | +AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Name of default gettext domain]) 100 | + 101 | +AM_GNU_GETTEXT([external]) 102 | +AM_GNU_GETTEXT_VERSION([0.19.8]) 103 | 104 | dnl 105 | dnl Enable gsettings schema macros 106 | @@ -611,6 +613,30 @@ fi 107 | AM_CONDITIONAL(HAVE_PAM, test x$have_pam = xyes) 108 | AC_SUBST(HAVE_PAM) 109 | 110 | +# Check if Linux-PAM is used. 111 | + 112 | +# OpenPAM has security/pam_types.h instead. 113 | +AC_CHECK_HEADER([security/_pam_types.h], 114 | + [have_linux_pam="yes"], [have_linux_pam="no"]) 115 | +if test "$have_linux_pam" = "yes" ; then 116 | + AC_DEFINE([HAVE_LINUX_PAM], 1, [Using Linux-PAM], []) 117 | +fi 118 | + 119 | +AC_ARG_WITH([linux-pam-localedir], 120 | + [AS_HELP_STRING([--with-linux-pam-localedir=LINUX_PAM_LOCALEDIR], 121 | + [Path to Linux-PAM localedir, used for auth message filtering])], 122 | + [linux_pam_localedir="$withval"], []) 123 | + 124 | +if test "$linux_pam_localedir" = "" ; then 125 | + linux_pam_localedir="`$PKG_CONFIG --variable=prefix pam 2>/dev/null`/share/locale" 126 | + 127 | + # Provide fallback for Linux-PAM < 1.5.3. 128 | + if test "$linux_pam_localedir" = "/share/locale" ; then 129 | + linux_pam_localedir="/usr/share/locale" 130 | + fi 131 | +fi 132 | + 133 | +AC_SUBST([linux_pam_localedir]) 134 | 135 | # Check for the nine billion variants of shadow passwords... 136 | 137 | @@ -1108,6 +1134,14 @@ echo " 138 | localstatedir: ${EXPANDED_LOCALSTATEDIR} 139 | datadir: ${EXPANDED_DATADIR} 140 | PAM prefix: ${PAM_PREFIX} 141 | + Linux-PAM used: ${have_linux_pam}" 142 | + 143 | +if test "x$have_linux_pam" = "xyes" ; then 144 | +echo \ 145 | +" Linux-PAM localedir: ${linux_pam_localedir}" 146 | +fi 147 | + 148 | +echo " 149 | source code location: ${srcdir} 150 | compiler: ${CC} 151 | cflags: ${CFLAGS} 152 | diff --git a/data/Makefile.am b/data/Makefile.am 153 | index 040ef26..c7c2ccc 100644 154 | --- a/data/Makefile.am 155 | +++ b/data/Makefile.am 156 | @@ -10,19 +10,23 @@ man_MANS = \ 157 | xfce4-screensaver-preferences.1 \ 158 | $(NULL) 159 | 160 | -@INTLTOOL_DESKTOP_RULE@ 161 | +xfce4-screensaver-preferences.desktop: xfce4-screensaver-preferences.desktop.in 162 | + $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ 163 | 164 | desktopdir = $(datadir)/applications 165 | desktop_in_files = xfce4-screensaver-preferences.desktop.in 166 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) 167 | 168 | -@INTLTOOL_DIRECTORY_RULE@ 169 | +# FIXME: xgettext doesn't recognize .directory.in files as desktop files so we 170 | +# use .desktop.in for the translation: is there a proper solution? 171 | +xfce4-screensaver.directory: xfce4-screensaver.desktop.in 172 | + $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ 173 | 174 | directorydir = $(datadir)/desktop-directories 175 | directory_in_files = \ 176 | - xfce4-screensaver.directory.in \ 177 | + xfce4-screensaver.desktop.in \ 178 | $(NULL) 179 | -directory_DATA = $(directory_in_files:.directory.in=.directory) 180 | +directory_DATA = $(directory_in_files:.desktop.in=.directory) 181 | 182 | menudir = $(sysconfdir)/xdg/menus 183 | menu_DATA = \ 184 | @@ -32,8 +36,6 @@ menu_DATA = \ 185 | dbussessionservicedir = $(DBUS_SESSION_SERVICE_DIR) 186 | dbussessionservice_DATA = org.xfce.ScreenSaver.service 187 | 188 | -@INTLTOOL_XML_NOMERGE_RULE@ 189 | - 190 | EXTRA_DIST = \ 191 | $(desktop_in_files) \ 192 | $(directory_in_files) \ 193 | diff --git a/data/xfce4-screensaver-preferences.desktop.in b/data/xfce4-screensaver-preferences.desktop.in 194 | index 9877634..42bdf77 100644 195 | --- a/data/xfce4-screensaver-preferences.desktop.in 196 | +++ b/data/xfce4-screensaver-preferences.desktop.in 197 | @@ -1,12 +1,13 @@ 198 | [Desktop Entry] 199 | -_Name=Xfce Screensaver 200 | -_Comment=Set your screensaver preferences 201 | -_GenericName=Screensaver 202 | +Name=Xfce Screensaver 203 | +Comment=Set your screensaver preferences 204 | +GenericName=Screensaver 205 | Icon=org.xfce.ScreenSaver 206 | Exec=xfce4-screensaver-preferences 207 | Terminal=false 208 | Type=Application 209 | Categories=GTK;Settings;DesktopSettings;X-XFCE-PersonalSettings;X-XFCE-SettingsDialog; 210 | +Keywords=settings;preferences;screensaver;lock screen; 211 | OnlyShowIn=XFCE; 212 | StartupNotify=true 213 | X-XFCE-Bugzilla-Bugzilla=XFCE 214 | diff --git a/data/xfce4-screensaver.directory.in b/data/xfce4-screensaver.desktop.in 215 | similarity index 69% 216 | rename from data/xfce4-screensaver.directory.in 217 | rename to data/xfce4-screensaver.desktop.in 218 | index f27e82e..8a34f03 100644 219 | --- a/data/xfce4-screensaver.directory.in 220 | +++ b/data/xfce4-screensaver.desktop.in 221 | @@ -1,7 +1,7 @@ 222 | [Desktop Entry] 223 | Encoding=UTF-8 224 | -_Name=Screensavers 225 | -_Comment=Screensaver themes 226 | +Name=Screensavers 227 | +Comment=Screensaver themes 228 | Icon=org.xfce.ScreenSaver 229 | Type=Directory 230 | OnlyShowIn=XFCE; 231 | diff --git a/po/LINGUAS b/po/LINGUAS 232 | index 83d6d43..9ed0fb1 100644 233 | --- a/po/LINGUAS 234 | +++ b/po/LINGUAS 235 | @@ -1,13 +1,15 @@ 236 | -# please keep this list sorted alphabetically 237 | -# 238 | be 239 | bg 240 | ca 241 | cs 242 | da 243 | de 244 | +el 245 | en_AU 246 | +en_CA 247 | +en_GB 248 | es 249 | +et 250 | eu 251 | fi 252 | fr 253 | @@ -15,9 +17,12 @@ gl 254 | he 255 | hu 256 | hy_AM 257 | +hye 258 | +id 259 | is 260 | it 261 | ja 262 | +kab 263 | ko 264 | lt 265 | ms 266 | @@ -34,5 +39,6 @@ sr 267 | sv 268 | th 269 | tr 270 | +uk 271 | zh_CN 272 | -zh_TW 273 | \ No newline at end of file 274 | +zh_TW 275 | diff --git a/po/Makevars b/po/Makevars 276 | new file mode 100644 277 | index 0000000..6a5044a 278 | --- /dev/null 279 | +++ b/po/Makevars 280 | @@ -0,0 +1,80 @@ 281 | +# Makefile variables for PO directory in any package using GNU gettext. 282 | + 283 | +# Usually the message domain is the same as the package name. 284 | +DOMAIN = $(PACKAGE) 285 | + 286 | +# These two variables depend on the location of this directory. 287 | +subdir = po 288 | +top_builddir = .. 289 | + 290 | +# These options get passed to xgettext. 291 | +XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ \ 292 | + --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 \ 293 | + --add-comments 294 | + 295 | +# This is the copyright holder that gets inserted into the header of the 296 | +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 297 | +# package. (Note that the msgstr strings, extracted from the package's 298 | +# sources, belong to the copyright holder of the package.) Translators are 299 | +# expected to transfer the copyright for their translations to this person 300 | +# or entity, or to disclaim their copyright. The empty string stands for 301 | +# the public domain; in this case the translators are expected to disclaim 302 | +# their copyright. 303 | +COPYRIGHT_HOLDER = The Xfce development team. 304 | + 305 | +# This tells whether or not to prepend "GNU " prefix to the package 306 | +# name that gets inserted into the header of the $(DOMAIN).pot file. 307 | +# Possible values are "yes", "no", or empty. If it is empty, try to 308 | +# detect it automatically by scanning the files in $(top_srcdir) for 309 | +# "GNU packagename" string. 310 | +PACKAGE_GNU = no 311 | + 312 | +# This is the email address or URL to which the translators shall report 313 | +# bugs in the untranslated strings: 314 | +# - Strings which are not entire sentences, see the maintainer guidelines 315 | +# in the GNU gettext documentation, section 'Preparing Strings'. 316 | +# - Strings which use unclear terms or require additional context to be 317 | +# understood. 318 | +# - Strings which make invalid assumptions about notation of date, time or 319 | +# money. 320 | +# - Pluralisation problems. 321 | +# - Incorrect English spelling. 322 | +# - Incorrect formatting. 323 | +# It can be your email address, or a mailing list address where translators 324 | +# can write to without being subscribed, or the URL of a web page through 325 | +# which the translators can contact you. 326 | +MSGID_BUGS_ADDRESS = 327 | + 328 | +# This is the list of locale categories, beyond LC_MESSAGES, for which the 329 | +# message catalogs shall be used. It is usually empty. 330 | +EXTRA_LOCALE_CATEGORIES = 331 | + 332 | +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' 333 | +# context. Possible values are "yes" and "no". Set this to yes if the 334 | +# package uses functions taking also a message context, like pgettext(), or 335 | +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. 336 | +USE_MSGCTXT = no 337 | + 338 | +# These options get passed to msgmerge. 339 | +# Useful options are in particular: 340 | +# --previous to keep previous msgids of translated messages, 341 | +# --quiet to reduce the verbosity. 342 | +MSGMERGE_OPTIONS = 343 | + 344 | +# These options get passed to msginit. 345 | +# If you want to disable line wrapping when writing PO files, add 346 | +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and 347 | +# MSGINIT_OPTIONS. 348 | +MSGINIT_OPTIONS = 349 | + 350 | +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot 351 | +# has changed. Possible values are "yes" and "no". Set this to no if 352 | +# the POT file is checked in the repository and the version control 353 | +# program ignores timestamps. 354 | +PO_DEPENDS_ON_POT = no 355 | + 356 | +# This tells whether or not to forcibly update $(DOMAIN).pot and 357 | +# regenerate PO files on "make dist". Possible values are "yes" and 358 | +# "no". Set this to no if the POT file and PO files are maintained 359 | +# externally. 360 | +DIST_DEPENDS_ON_UPDATE_PO = no 361 | diff --git a/po/POTFILES.in b/po/POTFILES.in 362 | index e3ccb4e..38b3eaa 100644 363 | --- a/po/POTFILES.in 364 | +++ b/po/POTFILES.in 365 | @@ -1,7 +1,7 @@ 366 | # List of source files containing translatable strings. 367 | # Please keep this file sorted alphabetically. 368 | data/xfce4-screensaver-preferences.desktop.in 369 | -data/xfce4-screensaver.directory.in 370 | +data/xfce4-screensaver.desktop.in 371 | savers/floaters.c 372 | savers/popsquares.c 373 | savers/slideshow.c 374 | @@ -12,11 +12,11 @@ src/gs-auth-pam.c 375 | src/gs-listener-dbus.c 376 | src/gs-lock-plug.c 377 | src/xfce4-screensaver-command.c 378 | -src/xfce4-screensaver-configure 379 | +src/xfce4-screensaver-configure.py 380 | src/xfce4-screensaver-dialog.c 381 | -[type: gettext/glade]src/xfce4-screensaver-dialog.ui 382 | +src/xfce4-screensaver-dialog.ui 383 | src/xfce4-screensaver-preferences.c 384 | -[type: gettext/glade]src/xfce4-screensaver-preferences.ui 385 | +src/xfce4-screensaver-preferences.ui 386 | src/xfce4-screensaver.c 387 | src/xfce4-screensaver.desktop.in.in 388 | src/xfcekbd-indicator.c 389 | diff --git a/savers/Makefile.am b/savers/Makefile.am 390 | index 1b20c54..db8910b 100644 391 | --- a/savers/Makefile.am 392 | +++ b/savers/Makefile.am 393 | @@ -24,7 +24,8 @@ xfce-personal-slideshow.desktop.in: xfce-personal-slideshow.desktop.in.in Makefi 394 | xfce-popsquares.desktop.in: xfce-popsquares.desktop.in.in Makefile 395 | $(edit) $< >$@ 396 | 397 | -@INTLTOOL_DESKTOP_RULE@ 398 | +%.desktop: %.desktop.in 399 | + $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ 400 | 401 | edit = sed \ 402 | -e 's|@FLOATERS_XFCE_IMAGE[@]|$(FLOATERS_XFCE_IMAGE)|g' \ 403 | diff --git a/savers/xfce-floaters.desktop.in.in b/savers/xfce-floaters.desktop.in.in 404 | index cb7f856..bc7f599 100644 405 | --- a/savers/xfce-floaters.desktop.in.in 406 | +++ b/savers/xfce-floaters.desktop.in.in 407 | @@ -1,6 +1,6 @@ 408 | [Desktop Entry] 409 | -_Name=Floating Xfce 410 | -_Comment=Bubbles the Xfce logo around the screen 411 | +Name=Floating Xfce 412 | +Comment=Bubbles the Xfce logo around the screen 413 | Exec=@SAVERDIR@/floaters @FLOATERS_XFCE_IMAGE@ 414 | TryExec=@SAVERDIR@/floaters 415 | StartupNotify=false 416 | diff --git a/savers/xfce-personal-slideshow.desktop.in.in b/savers/xfce-personal-slideshow.desktop.in.in 417 | index c4091e0..764935c 100644 418 | --- a/savers/xfce-personal-slideshow.desktop.in.in 419 | +++ b/savers/xfce-personal-slideshow.desktop.in.in 420 | @@ -1,6 +1,6 @@ 421 | [Desktop Entry] 422 | -_Name=Slideshow 423 | -_Comment=Display a slideshow from your Pictures folder 424 | +Name=Slideshow 425 | +Comment=Display a slideshow from your Pictures folder 426 | Exec=@SAVERDIR@/slideshow 427 | TryExec=@SAVERDIR@/slideshow 428 | StartupNotify=false 429 | diff --git a/savers/xfce-popsquares.desktop.in.in b/savers/xfce-popsquares.desktop.in.in 430 | index 24d09e4..86c234b 100644 431 | --- a/savers/xfce-popsquares.desktop.in.in 432 | +++ b/savers/xfce-popsquares.desktop.in.in 433 | @@ -1,6 +1,6 @@ 434 | [Desktop Entry] 435 | -_Name=Pop art squares 436 | -_Comment=A pop-art-ish grid of pulsing colors. 437 | +Name=Pop art squares 438 | +Comment=A pop-art-ish grid of pulsing colors. 439 | Exec=@SAVERDIR@/popsquares 440 | TryExec=@SAVERDIR@/popsquares 441 | StartupNotify=false 442 | diff --git a/src/Makefile.am b/src/Makefile.am 443 | index 60bdbea..6d4268e 100644 444 | --- a/src/Makefile.am 445 | +++ b/src/Makefile.am 446 | @@ -18,6 +18,7 @@ AM_CPPFLAGS = \ 447 | -DDATADIR=\""$(datadir)"\" \ 448 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ 449 | -DXFCELOCALEDIR=\""$(datadir)/locale"\" \ 450 | + -DLINUXPAMLOCALEDIR=\""$(linux_pam_localedir)"\" \ 451 | -DSAVERDIR=\""$(saverdir)"\" \ 452 | -DTHEMESDIR=\""$(themesdir)"\" \ 453 | -DGTKBUILDERDIR=\"$(pkgdatadir)\" \ 454 | @@ -40,7 +41,7 @@ bin_PROGRAMS = \ 455 | $(NULL) 456 | 457 | bin_SCRIPTS = \ 458 | - xfce4-screensaver-configure \ 459 | + xfce4-screensaver-configure.py \ 460 | $(NULL) 461 | 462 | libexec_PROGRAMS = \ 463 | @@ -56,7 +57,9 @@ noinst_PROGRAMS = \ 464 | desktopdir = $(sysconfdir)/xdg/autostart 465 | desktop_in_files = xfce4-screensaver.desktop.in 466 | desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) 467 | -@INTLTOOL_DESKTOP_RULE@ 468 | + 469 | +xfce4-screensaver.desktop: xfce4-screensaver.desktop.in 470 | + $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ 471 | 472 | xfce4_screensaver_command_SOURCES = \ 473 | xfce4-screensaver-command.c \ 474 | @@ -271,7 +274,7 @@ EXTRA_DIST = \ 475 | debug-screensaver.sh \ 476 | gs-marshal.list \ 477 | xfce4-screensaver.desktop.in \ 478 | - xfce4-screensaver-configure \ 479 | + xfce4-screensaver-configure.py \ 480 | xfce4-screensaver-dialog.css \ 481 | xfce4-screensaver-dialog.ui \ 482 | xfce4-screensaver-preferences.ui \ 483 | diff --git a/src/gs-auth-pam.c b/src/gs-auth-pam.c 484 | index 8bbbfc3..9b0b501 100644 485 | --- a/src/gs-auth-pam.c 486 | +++ b/src/gs-auth-pam.c 487 | @@ -160,8 +160,10 @@ auth_message_handler (GSAuthMessageStyle style, 488 | case GS_AUTH_MESSAGE_PROMPT_ECHO_ON: 489 | break; 490 | case GS_AUTH_MESSAGE_PROMPT_ECHO_OFF: 491 | - if (msg != NULL && g_str_has_prefix (msg, _("Password:"))) { 492 | - did_we_ask_for_password = TRUE; 493 | + if (msg != NULL) { 494 | + did_we_ask_for_password = g_str_equal (msg, pam_dgettext ("Password: ")) || 495 | + // "Password:" is the default on OpenPAM. 496 | + g_str_equal (msg, "Password:"); 497 | } 498 | break; 499 | case GS_AUTH_MESSAGE_ERROR_MSG: 500 | diff --git a/src/gs-auth.h b/src/gs-auth.h 501 | index 113ef88..30f577c 100644 502 | --- a/src/gs-auth.h 503 | +++ b/src/gs-auth.h 504 | @@ -26,6 +26,13 @@ 505 | 506 | G_BEGIN_DECLS 507 | 508 | +#ifdef HAVE_LINUX_PAM 509 | +#include 510 | +#define pam_dgettext(msgid) dgettext ("Linux-PAM", msgid) 511 | +#else 512 | +#define pam_dgettext(msgid) (msgid) 513 | +#endif 514 | + 515 | typedef enum 516 | { 517 | GS_AUTH_MESSAGE_PROMPT_ECHO_ON, 518 | diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c 519 | index 0a51bb0..733c081 100644 520 | --- a/src/gs-lock-plug.c 521 | +++ b/src/gs-lock-plug.c 522 | @@ -65,7 +65,8 @@ 523 | #define LOGGED_IN_EMBLEM_SIZE 20 524 | #define LOGGED_IN_EMBLEM_ICON "emblem-default" 525 | 526 | -static void gs_lock_plug_finalize (GObject *object); 527 | +static void gs_lock_plug_constructed (GObject *object); 528 | +static void gs_lock_plug_finalize (GObject *object); 529 | 530 | struct GSLockPlugPrivate { 531 | GtkWidget *vbox; 532 | @@ -269,9 +270,9 @@ do_user_switch (GSLockPlug *plug) { 533 | static void 534 | set_status_text (GSLockPlug *plug, 535 | const char *text) { 536 | - if (plug->priv->auth_message_label != NULL) { 537 | + if (plug->priv->auth_message_label != NULL && g_utf8_validate (text, -1, NULL)) { 538 | gtk_label_set_text (GTK_LABEL (plug->priv->auth_message_label), text); 539 | - if (g_utf8_strlen (text, 1) == 0) { 540 | + if (g_utf8_strlen (text, -1) == 0) { 541 | gtk_widget_hide (GTK_WIDGET (plug->priv->auth_message_label)); 542 | } else { 543 | gtk_widget_show (GTK_WIDGET (plug->priv->auth_message_label)); 544 | @@ -1013,6 +1014,7 @@ gs_lock_plug_class_init (GSLockPlugClass *klass) { 545 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); 546 | GtkBindingSet *binding_set; 547 | 548 | + object_class->constructed = gs_lock_plug_constructed; 549 | object_class->finalize = gs_lock_plug_finalize; 550 | object_class->get_property = gs_lock_plug_get_property; 551 | object_class->set_property = gs_lock_plug_set_property; 552 | @@ -1045,28 +1047,28 @@ gs_lock_plug_class_init (GSLockPlugClass *klass) { 553 | NULL, 554 | NULL, 555 | FALSE, 556 | - G_PARAM_READWRITE)); 557 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); 558 | g_object_class_install_property (object_class, 559 | PROP_LOGOUT_COMMAND, 560 | g_param_spec_string ("logout-command", 561 | NULL, 562 | NULL, 563 | NULL, 564 | - G_PARAM_READWRITE)); 565 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); 566 | g_object_class_install_property (object_class, 567 | PROP_STATUS_MESSAGE, 568 | g_param_spec_string ("status-message", 569 | NULL, 570 | NULL, 571 | NULL, 572 | - G_PARAM_READWRITE)); 573 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); 574 | g_object_class_install_property (object_class, 575 | PROP_SWITCH_ENABLED, 576 | g_param_spec_boolean ("switch-enabled", 577 | NULL, 578 | NULL, 579 | FALSE, 580 | - G_PARAM_READWRITE)); 581 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); 582 | g_object_class_install_property (object_class, 583 | PROP_MONITOR_INDEX, 584 | g_param_spec_int ("monitor-index", 585 | @@ -1075,7 +1077,7 @@ gs_lock_plug_class_init (GSLockPlugClass *klass) { 586 | 0, 587 | 200, 588 | 0, 589 | - G_PARAM_READWRITE)); 590 | + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); 591 | 592 | binding_set = gtk_binding_set_by_class (klass); 593 | 594 | @@ -1573,8 +1575,6 @@ gs_lock_plug_add_login_window (GSLockPlug *plug) { 595 | gtk_widget_set_no_show_all (plug->priv->auth_switch_button, TRUE); 596 | } 597 | 598 | - redraw_background (plug); 599 | - 600 | date_time_update (plug); 601 | gtk_widget_show_all (lock_dialog); 602 | 603 | @@ -1692,6 +1692,15 @@ gs_lock_plug_init (GSLockPlug *plug) { 604 | gs_profile_end (NULL); 605 | } 606 | 607 | +static void 608 | +gs_lock_plug_constructed (GObject *object) { 609 | + GSLockPlug *plug = GS_LOCK_PLUG (object); 610 | + 611 | + redraw_background (plug); 612 | + 613 | + G_OBJECT_CLASS (gs_lock_plug_parent_class)->constructed (object); 614 | +} 615 | + 616 | static void 617 | gs_lock_plug_finalize (GObject *object) { 618 | GSLockPlug *plug; 619 | @@ -1716,12 +1725,20 @@ gs_lock_plug_finalize (GObject *object) { 620 | } 621 | 622 | GtkWidget * 623 | -gs_lock_plug_new (void) { 624 | - GtkWidget *result; 625 | - 626 | - result = g_object_new (GS_TYPE_LOCK_PLUG, NULL); 627 | +gs_lock_plug_new (gboolean logout_enabled, 628 | + const gchar *logout_command, 629 | + gboolean switch_enabled, 630 | + const gchar *status_message, 631 | + gint monitor_index) { 632 | + GtkWidget *plug = g_object_new (GS_TYPE_LOCK_PLUG, 633 | + "logout-enabled", logout_enabled, 634 | + "logout-command", logout_command, 635 | + "switch-enabled", switch_enabled, 636 | + "status-message", status_message, 637 | + "monitor-index", monitor_index, 638 | + NULL); 639 | 640 | - gtk_window_set_focus_on_map (GTK_WINDOW (result), TRUE); 641 | + gtk_window_set_focus_on_map (GTK_WINDOW (plug), TRUE); 642 | 643 | - return result; 644 | + return plug; 645 | } 646 | diff --git a/src/gs-lock-plug.h b/src/gs-lock-plug.h 647 | index f0c47d6..9b491bb 100644 648 | --- a/src/gs-lock-plug.h 649 | +++ b/src/gs-lock-plug.h 650 | @@ -61,7 +61,11 @@ typedef struct 651 | } GSLockPlugClass; 652 | 653 | GType gs_lock_plug_get_type (void); 654 | -GtkWidget * gs_lock_plug_new (void); 655 | +GtkWidget * gs_lock_plug_new (gboolean logout_enabled, 656 | + const gchar *logout_command, 657 | + gboolean switch_enabled, 658 | + const gchar *status_message, 659 | + gint monitor_index); 660 | 661 | int gs_lock_plug_run (GSLockPlug *plug); 662 | void gs_lock_plug_set_sensitive (GSLockPlug *plug, 663 | diff --git a/src/xfce4-screensaver-configure b/src/xfce4-screensaver-configure.py 664 | similarity index 100% 665 | rename from src/xfce4-screensaver-configure 666 | rename to src/xfce4-screensaver-configure.py 667 | diff --git a/src/xfce4-screensaver-dialog.c b/src/xfce4-screensaver-dialog.c 668 | index 382d637..0d4dcfe 100644 669 | --- a/src/xfce4-screensaver-dialog.c 670 | +++ b/src/xfce4-screensaver-dialog.c 671 | @@ -158,68 +158,10 @@ static char* request_response(GSLockPlug* plug, 672 | return text; 673 | } 674 | 675 | -/* Adapted from MDM2 daemon/verify-pam.c on 2006-06-13 */ 676 | -static const char* maybe_translate_message(const char* msg) { 677 | - char *s; 678 | - const char *ret; 679 | - static GHashTable *hash = NULL; 680 | - 681 | - if (hash == NULL) { 682 | - /* Here we come with some fairly standard messages so that 683 | - we have as much as possible translated. Should really be 684 | - translated in pam I suppose. This way we can "change" 685 | - some of these messages to be more sane. */ 686 | - hash = g_hash_table_new (g_str_hash, g_str_equal); 687 | - /* login: is whacked always translate to Username: */ 688 | - g_hash_table_insert(hash, "login:", 689 | - _("Please enter your username.")); 690 | - g_hash_table_insert(hash, "Username:", 691 | - _("Please enter your username.")); 692 | - g_hash_table_insert(hash, "username:", _("Please enter your username.")); 693 | - g_hash_table_insert(hash, "Password:", 694 | - ""); 695 | - g_hash_table_insert(hash, "password:", 696 | - ""); 697 | - g_hash_table_insert(hash, "You are required to change your password immediately (password aged)", 698 | - _("You are required to change your password immediately (password aged)")); 699 | - g_hash_table_insert(hash, "You are required to change your password immediately (root enforced)", 700 | - _("You are required to change your password immediately (root enforced)")); 701 | - g_hash_table_insert(hash, "Your account has expired; please contact your system administrator", 702 | - _("Your account has expired; please contact your system administrator")); 703 | - g_hash_table_insert(hash, "No password supplied", 704 | - _("No password supplied.")); 705 | - g_hash_table_insert(hash, "Password unchanged", 706 | - _("Password unchanged.")); 707 | - g_hash_table_insert(hash, "Can not get username", 708 | - _("Can not get username.")); 709 | - g_hash_table_insert(hash, "Retype new UNIX password:", 710 | - _("Retype your new password.")); 711 | - g_hash_table_insert(hash, "Enter new UNIX password:", 712 | - _("Enter your new password.")); 713 | - g_hash_table_insert(hash, "(current) UNIX password:", 714 | - _("Enter your current password:")); 715 | - g_hash_table_insert(hash, "Error while changing NIS password.", 716 | - _("Error while changing NIS password.")); 717 | - g_hash_table_insert(hash, "You must choose a longer password", 718 | - _("You must choose a longer password.")); 719 | - g_hash_table_insert(hash, "Password has been already used. Choose another.", 720 | - _("Password has been already used. Choose another.")); 721 | - g_hash_table_insert(hash, "You must wait longer to change your password", 722 | - _("You must wait longer to change your password.")); 723 | - g_hash_table_insert(hash, "Sorry, passwords do not match", 724 | - _("Sorry, passwords do not match.")); 725 | - /* FIXME: what about messages which have some variables in them, perhaps try to do those as well */ 726 | - } 727 | - 728 | - s = g_strstrip(g_strdup(msg)); 729 | - ret = g_hash_table_lookup(hash, s); 730 | - g_free(s); 731 | - 732 | - if (ret != NULL) { 733 | - return ret; 734 | - } else { 735 | - return msg; 736 | - } 737 | +static gboolean status_text_should_be_hidden(const char* msg) { 738 | + return g_str_equal(msg, pam_dgettext("Password: ")) || 739 | + // "Password:" is the default on OpenPAM. 740 | + g_str_equal(msg, "Password:"); 741 | } 742 | 743 | static gboolean auth_message_handler(GSAuthMessageStyle style, 744 | @@ -240,7 +182,7 @@ static gboolean auth_message_handler(GSAuthMessageStyle style, 745 | 746 | ret = TRUE; 747 | *response = NULL; 748 | - message = maybe_translate_message(msg); 749 | + message = status_text_should_be_hidden(msg) ? "" : msg; 750 | 751 | switch (style) { 752 | case GS_AUTH_MESSAGE_PROMPT_ECHO_ON: 753 | @@ -384,28 +326,8 @@ static gboolean popup_dialog_idle(gpointer user_data) { 754 | 755 | gs_profile_start(NULL); 756 | 757 | - widget = gs_lock_plug_new(); 758 | - 759 | - if (enable_logout) { 760 | - g_object_set(widget, "logout-enabled", TRUE, NULL); 761 | - } 762 | - 763 | - if (logout_command) { 764 | - g_object_set(widget, "logout-command", logout_command, NULL); 765 | - } 766 | - 767 | - if (enable_switch) { 768 | - g_object_set(widget, "switch-enabled", TRUE, NULL); 769 | - } 770 | - 771 | - if (status_message) { 772 | - g_object_set(widget, "status-message", status_message, NULL); 773 | - } 774 | - 775 | - g_object_set(widget, "monitor-index", monitor_index, NULL); 776 | - 777 | + widget = gs_lock_plug_new(enable_logout, logout_command, enable_switch, status_message, monitor_index); 778 | gtk_widget_set_size_request(widget, dialog_width, dialog_height); 779 | - 780 | g_signal_connect(GS_LOCK_PLUG(widget), "response", G_CALLBACK(response_cb), NULL); 781 | g_signal_connect(widget, "show", G_CALLBACK(show_cb), NULL); 782 | 783 | @@ -544,6 +466,10 @@ int main(int argc, 784 | GError *error = NULL; 785 | char *nolock_reason = NULL; 786 | 787 | + /* The order matters since xfce_textdomain sets default domain. */ 788 | +#ifdef HAVE_LINUX_PAM 789 | + xfce_textdomain ("Linux-PAM", LINUXPAMLOCALEDIR, "UTF-8"); 790 | +#endif 791 | xfce_textdomain (GETTEXT_PACKAGE, XFCELOCALEDIR, "UTF-8"); 792 | 793 | gs_profile_start(NULL); 794 | diff --git a/src/xfce4-screensaver-preferences.c b/src/xfce4-screensaver-preferences.c 795 | index 88cf7f6..f1f8b06 100644 796 | --- a/src/xfce4-screensaver-preferences.c 797 | +++ b/src/xfce4-screensaver-preferences.c 798 | @@ -47,7 +47,7 @@ 799 | #include "xfce4-screensaver-preferences-ui.h" 800 | 801 | #define GPM_COMMAND "xfce4-power-manager-settings" 802 | -#define CONFIGURE_COMMAND "xfce4-screensaver-configure" 803 | +#define CONFIGURE_COMMAND "xfce4-screensaver-configure.py" 804 | 805 | enum { 806 | NAME_COLUMN = 0, 807 | diff --git a/src/xfce4-screensaver.desktop.in.in b/src/xfce4-screensaver.desktop.in.in 808 | index d9e7b58..46dceb6 100644 809 | --- a/src/xfce4-screensaver.desktop.in.in 810 | +++ b/src/xfce4-screensaver.desktop.in.in 811 | @@ -1,8 +1,8 @@ 812 | [Desktop Entry] 813 | Type=Application 814 | -_Name=Xfce Screensaver 815 | -_Comment=Launch screensaver and locker program 816 | -_GenericName=Screensaver 817 | +Name=Xfce Screensaver 818 | +Comment=Launch screensaver and locker program 819 | +GenericName=Screensaver 820 | Icon=org.xfce.ScreenSaver 821 | Exec=xfce4-screensaver 822 | OnlyShowIn=XFCE; 823 | -------------------------------------------------------------------------------- /desktop/patches/xfwm4-title-center.patch: -------------------------------------------------------------------------------- 1 | diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c 2 | index b43757c74059210ba84f06f7203aa76043eead7b..966e9d9b83b231864c02c21294d9be2a05e41582 100644 3 | --- a/settings-dialogs/xfwm4-settings.c 4 | +++ b/settings-dialogs/xfwm4-settings.c 5 | @@ -226,7 +226,8 @@ static const MenuTemplate double_click_values[] = { 6 | 7 | static const MenuTemplate title_align_values[] = { 8 | { N_("Left"), "left" }, 9 | - { N_("Center"), "center" }, 10 | + { N_("Center in Free Space"), "center" }, 11 | + { N_("Center in Window"), "center_window" }, 12 | { N_("Right"), "right" }, 13 | { NULL, NULL }, 14 | }; 15 | diff --git a/src/frame.c b/src/frame.c 16 | index 279baeecb2032009fcd12525f8351936c41355a8..cdd530bc380943e443fd6fd6b77404c18bfc2bc9 100644 17 | --- a/src/frame.c 18 | +++ b/src/frame.c 19 | @@ -253,6 +253,9 @@ frameCreateTitlePixmap (Client * c, int state, int left, int right, xfwmPixmap * 20 | case ALIGN_CENTER: 21 | hoffset = (w3 / 2) - (logical_rect.width / 2); 22 | break; 23 | + case ALIGN_CENTER_WINDOW: 24 | + hoffset = (width / 2) - (logical_rect.width / 2) - left; 25 | + break; 26 | } 27 | if (hoffset < screen_info->params->title_horizontal_offset) 28 | { 29 | @@ -282,6 +285,9 @@ frameCreateTitlePixmap (Client * c, int state, int left, int right, xfwmPixmap * 30 | case ALIGN_CENTER: 31 | w1 = left + ((right - left) / 2) - (w3 / 2) - w2; 32 | break; 33 | + case ALIGN_CENTER_WINDOW: 34 | + w1 = (width / 2) - (logical_rect.width / 2) - w2; 35 | + break; 36 | } 37 | if (w1 < left) 38 | { 39 | diff --git a/src/settings.c b/src/settings.c 40 | index ce4a05e8a384ba51ec94901ecc9c69e8eb90b4f6..d258643dd43b4f026a8b401d8d0a1c1463dca670 100644 41 | --- a/src/settings.c 42 | +++ b/src/settings.c 43 | @@ -529,6 +529,10 @@ loadTheme (ScreenInfo *screen_info, Settings *rc) 44 | { 45 | screen_info->params->title_alignment = ALIGN_RIGHT; 46 | } 47 | + else if (!g_ascii_strcasecmp ("center_window", getStringValue ("title_alignment", rc))) 48 | + { 49 | + screen_info->params->title_alignment = ALIGN_CENTER_WINDOW; 50 | + } 51 | else 52 | { 53 | screen_info->params->title_alignment = ALIGN_CENTER; 54 | diff --git a/src/settings.h b/src/settings.h 55 | index 4293dc096fb667f94d59670cb205ebfae2ffd960..26fe71d3604c0457c5d4e230c792c6b4f86af34f 100644 56 | --- a/src/settings.h 57 | +++ b/src/settings.h 58 | @@ -138,7 +138,8 @@ enum 59 | { 60 | ALIGN_LEFT, 61 | ALIGN_RIGHT, 62 | - ALIGN_CENTER 63 | + ALIGN_CENTER, 64 | + ALIGN_CENTER_WINDOW 65 | }; 66 | 67 | enum 68 | -------------------------------------------------------------------------------- /desktop/pkgs/dingtalk/default.nix: -------------------------------------------------------------------------------- 1 | # https://github.com/nix-community/nur-combined/blob/master/repos/xddxdd/pkgs/uncategorized/dingtalk/default.nix#L155 2 | # nix profile install .#dingtalk --override-input nixpkgs 'git+file:///home/bobby285271/nixpkgs?ref=release-22.11' --impure 3 | 4 | { 5 | fetchurl, 6 | stdenv, 7 | autoPatchelfHook, 8 | makeWrapper, 9 | lib, 10 | callPackage, 11 | # DingTalk dependencies 12 | alsa-lib, 13 | at-spi2-atk, 14 | at-spi2-core, 15 | cairo, 16 | cups, 17 | curl, 18 | dbus, 19 | e2fsprogs, 20 | gdk-pixbuf, 21 | glib, 22 | gnutls, 23 | graphite2, 24 | gtk2, 25 | harfbuzz, 26 | krb5, 27 | libdrm, 28 | libgcrypt, 29 | libGLU, 30 | libinput, 31 | libpulseaudio, 32 | libsForQt5, 33 | libthai, 34 | libxkbcommon, 35 | mesa, 36 | mtdev, 37 | nspr, 38 | nss, 39 | openldap, 40 | pango, 41 | rtmpdump, 42 | udev, 43 | util-linux, 44 | xorg, 45 | }: 46 | 47 | let 48 | libraries = [ 49 | alsa-lib 50 | at-spi2-atk 51 | at-spi2-core 52 | cairo 53 | cups 54 | curl 55 | dbus 56 | e2fsprogs 57 | gdk-pixbuf 58 | glib 59 | gnutls 60 | graphite2 61 | (gtk2.override { 62 | pango = pango.override { 63 | harfbuzz = callPackage ./harfbuzz.nix { 64 | ApplicationServices = null; 65 | CoreText = null; 66 | }; 67 | }; 68 | }) 69 | krb5 70 | libdrm 71 | libgcrypt 72 | libGLU 73 | libinput 74 | libpulseaudio 75 | libsForQt5.qtbase 76 | libthai 77 | libxkbcommon 78 | mesa.drivers 79 | mtdev 80 | nspr 81 | nss 82 | openldap 83 | rtmpdump 84 | udev 85 | util-linux 86 | xorg.libICE 87 | xorg.libSM 88 | xorg.libX11 89 | xorg.libxcb 90 | xorg.libXcomposite 91 | xorg.libXcursor 92 | xorg.libXdamage 93 | xorg.libXext 94 | xorg.libXfixes 95 | xorg.libXi 96 | xorg.libXinerama 97 | xorg.libXmu 98 | xorg.libXrandr 99 | xorg.libXrender 100 | xorg.libXScrnSaver 101 | xorg.libXt 102 | xorg.libXtst 103 | xorg.xcbutilimage 104 | xorg.xcbutilkeysyms 105 | xorg.xcbutilrenderutil 106 | xorg.xcbutilwm 107 | ]; 108 | in 109 | stdenv.mkDerivation rec { 110 | version = "1.7.0.30419"; 111 | pname = "dingtalk"; 112 | 113 | src = fetchurl { 114 | url = "https://dtapp-pub.dingtalk.com/dingtalk-desktop/xc_dingtalk_update/linux_deb/Release/com.alibabainc.dingtalk_${version}_amd64.deb"; 115 | sha256 = "sha256-Ycq3YzhIbk8nRltgcVgDFQUFqKq57kmcAlOsh/t9UGI="; 116 | }; 117 | 118 | nativeBuildInputs = [ 119 | autoPatchelfHook 120 | makeWrapper 121 | libsForQt5.wrapQtAppsHook 122 | ]; 123 | buildInputs = libraries; 124 | 125 | unpackPhase = '' 126 | ar x ${src} 127 | tar xf data.tar.xz 128 | 129 | mv opt/apps/com.alibabainc.dingtalk/files/version version 130 | mv opt/apps/com.alibabainc.dingtalk/files/*-Release.* release 131 | 132 | # Cleanup 133 | rm -rf release/Resources/{i18n/tool/*.exe,qss/mac} 134 | rm -f release/{*.a,*.la,*.prl} 135 | rm -f release/dingtalk_updater 136 | rm -f release/libcurl.so.* 137 | rm -f release/libgtk-x11-2.0.so.* 138 | rm -f release/libm.so.* 139 | rm -f release/libstdc++.so.6 140 | rm -f release/libz* 141 | ''; 142 | 143 | installPhase = '' 144 | mkdir -p $out 145 | mv version $out/ 146 | 147 | # Move libraries 148 | # DingTalk relies on (some of) the exact libraries it ships with 149 | mv release $out/lib 150 | 151 | # Entrypoint 152 | mkdir -p $out/bin 153 | makeWrapper $out/lib/com.alibabainc.dingtalk $out/bin/dingtalk \ 154 | --argv0 "com.alibabainc.dingtalk" \ 155 | --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libraries}" 156 | 157 | # App Menu 158 | mkdir -p $out/share/applications $out/share/pixmaps 159 | ln -s ${./dingtalk.desktop} $out/share/applications/dingtalk.desktop 160 | ln -s ${./dingtalk.png} $out/share/pixmaps/dingtalk.png 161 | ''; 162 | 163 | meta = with lib; { 164 | description = "钉钉"; 165 | homepage = "https://www.dingtalk.com/"; 166 | platforms = [ "x86_64-linux" ]; 167 | license = licenses.unfreeRedistributable; 168 | }; 169 | } 170 | -------------------------------------------------------------------------------- /desktop/pkgs/dingtalk/dingtalk.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Categories=Chat; 3 | Comment= 4 | Exec=dingtalk %u 5 | GenericName=dingtalk 6 | Icon=dingtalk 7 | Keywords=dingtalk; 8 | MimeType=x-scheme-handler/dingtalk; 9 | Name=钉钉 10 | Type=Application 11 | X-Deepin-Vendor=user-custom -------------------------------------------------------------------------------- /desktop/pkgs/dingtalk/dingtalk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby285271/nixos-config/b3ad4a0749940fe8f52c7b08f996956fcd8bef74/desktop/pkgs/dingtalk/dingtalk.png -------------------------------------------------------------------------------- /desktop/pkgs/dingtalk/harfbuzz.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | pkg-config, 6 | glib, 7 | freetype, 8 | fontconfig, 9 | libintl, 10 | meson, 11 | ninja, 12 | gobject-introspection, 13 | icu, 14 | graphite2, 15 | harfbuzz, 16 | # The icu variant uses and propagates the non-icu one. 17 | ApplicationServices, 18 | CoreText, 19 | withCoreText ? false, 20 | withIcu ? false, 21 | # recommended by upstream as default, but most don't needed and it's big 22 | withGraphite2 ? true, 23 | # it is small and major distros do include it 24 | python3, 25 | gtk-doc, 26 | docbook-xsl-nons, 27 | docbook_xml_dtd_43, 28 | # for passthru.tests 29 | gimp, 30 | gtk3, 31 | gtk4, 32 | mapnik, 33 | qt5, 34 | }: 35 | 36 | let 37 | version = "3.3.2"; 38 | inherit (lib) optional optionals optionalString; 39 | mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}"; 40 | isNativeCompilation = stdenv.buildPlatform == stdenv.hostPlatform; 41 | in 42 | stdenv.mkDerivation { 43 | pname = "harfbuzz${optionalString withIcu "-icu"}"; 44 | inherit version; 45 | 46 | src = fetchFromGitHub { 47 | owner = "harfbuzz"; 48 | repo = "harfbuzz"; 49 | rev = version; 50 | sha256 = "sha256-UbYqV7Ch9ugTIwSsCpjnS8H7tcv4P3OVpFDFDZtQCk0="; 51 | }; 52 | 53 | postPatch = 54 | '' 55 | patchShebangs src/*.py test 56 | '' 57 | + lib.optionalString stdenv.isDarwin '' 58 | # ApplicationServices.framework headers have cast-align warnings. 59 | substituteInPlace src/hb.hh \ 60 | --replace '#pragma GCC diagnostic error "-Wcast-align"' "" 61 | ''; 62 | 63 | outputs = [ 64 | "out" 65 | "dev" 66 | "devdoc" 67 | ]; 68 | outputBin = "dev"; 69 | 70 | mesonFlags = [ 71 | # upstream recommends cairo, but it is only used for development purposes 72 | # and is not part of the library. 73 | # Cairo causes transitive (build) dependencies on various X11 or other 74 | # GUI-related libraries, so it shouldn't be re-added lightly. 75 | (mesonFeatureFlag "cairo" false) 76 | # chafa is only used in a development utility, not in the library 77 | (mesonFeatureFlag "chafa" false) 78 | (mesonFeatureFlag "coretext" withCoreText) 79 | (mesonFeatureFlag "graphite" withGraphite2) 80 | (mesonFeatureFlag "icu" withIcu) 81 | (mesonFeatureFlag "introspection" isNativeCompilation) 82 | ]; 83 | 84 | nativeBuildInputs = [ 85 | meson 86 | ninja 87 | gobject-introspection 88 | libintl 89 | pkg-config 90 | python3 91 | gtk-doc 92 | docbook-xsl-nons 93 | docbook_xml_dtd_43 94 | ]; 95 | 96 | buildInputs = 97 | [ 98 | glib 99 | freetype 100 | ] 101 | ++ lib.optionals withCoreText [ 102 | ApplicationServices 103 | CoreText 104 | ] 105 | ++ lib.optionals isNativeCompilation [ gobject-introspection ]; 106 | 107 | propagatedBuildInputs = 108 | optional withGraphite2 graphite2 109 | ++ optionals withIcu [ 110 | icu 111 | harfbuzz 112 | ]; 113 | 114 | doCheck = true; 115 | 116 | # Slightly hacky; some pkgs expect them in a single directory. 117 | postFixup = optionalString withIcu '' 118 | rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc" 119 | ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la 120 | ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc 121 | ${optionalString stdenv.isDarwin '' 122 | ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.dylib 123 | ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib 124 | ''} 125 | ''; 126 | 127 | passthru.tests = { 128 | inherit 129 | gimp 130 | gtk3 131 | gtk4 132 | mapnik 133 | ; 134 | inherit (qt5) qtbase; 135 | }; 136 | 137 | meta = with lib; { 138 | description = "An OpenType text shaping engine"; 139 | homepage = "https://harfbuzz.github.io/"; 140 | maintainers = [ maintainers.eelco ]; 141 | license = licenses.mit; 142 | platforms = with platforms; linux ++ darwin; 143 | }; 144 | } 145 | -------------------------------------------------------------------------------- /desktop/pkgs/libreoffice-icon-fixed.nix: -------------------------------------------------------------------------------- 1 | { 2 | symlinkJoin, 3 | lib, 4 | libreoffice-fresh, 5 | libreoffice-fresh-unwrapped, 6 | }: 7 | 8 | symlinkJoin { 9 | name = "libreoffice-icon-fixed"; 10 | 11 | paths = [ libreoffice-fresh ]; 12 | 13 | postBuild = '' 14 | rm -rf $out/share 15 | 16 | TMPDIR=$(mktemp -d) 17 | cp -r ${libreoffice-fresh-unwrapped}/. $TMPDIR 18 | chmod -R +w $TMPDIR 19 | rm $TMPDIR/share/applications # symbolic link 20 | cp -r ${libreoffice-fresh}/share/applications/ $TMPDIR/share/applications/ 21 | chmod -R +w $TMPDIR 22 | 23 | pushd $TMPDIR/share/applications 24 | cat calc.desktop | grep 'Icon=calc' > /dev/null 25 | find . -type f -exec sed -i \ 26 | -e s,Icon=,Icon=libreoffice-,g \ 27 | -e s,Icon=libreoffice-document-new,Icon=document-new,g \ 28 | {} + 29 | popd 30 | 31 | pushd $TMPDIR/share/icons 32 | [ ! -f 'hicolor/32x32/apps/libreoffice-base.png' ] 33 | [ -f 'hicolor/32x32/apps/base.png' ] 34 | # https://unix.stackexchange.com/questions/310256/for-all-directories-rename-all-subdirectories-with-a-prefix 35 | find . -maxdepth 4 -mindepth 4 -type f -execdir bash -c 'cp "$1" "./libreoffice-''${1#./}"' mover {} \; 36 | popd 37 | 38 | cp -r $TMPDIR/share $out 39 | 40 | cat $out/share/applications/calc.desktop | grep 'Icon=libreoffice-calc' > /dev/null 41 | cat $out/share/applications/calc.desktop | grep 'Icon=document-new' > /dev/null 42 | [ -f "$out/share/icons/hicolor/32x32/apps/libreoffice-base.png" ] 43 | ''; 44 | } 45 | -------------------------------------------------------------------------------- /desktop/pkgs/mate-menu.nix: -------------------------------------------------------------------------------- 1 | { 2 | python3, 3 | lib, 4 | fetchFromGitHub, 5 | intltool, 6 | glib, 7 | gobject-introspection, 8 | xvfb-run, 9 | wrapGAppsHook, 10 | gtk3, 11 | mate, 12 | }: 13 | 14 | python3.pkgs.buildPythonApplication rec { 15 | pname = "mate-menu"; 16 | version = "22.04.2"; 17 | 18 | src = fetchFromGitHub { 19 | owner = "ubuntu-mate"; 20 | repo = pname; 21 | rev = version; 22 | hash = "sha256-oeUAoeZppwIaa2Lfi9qkVbMHP/kJjiPUXlvoKAlsefo="; 23 | }; 24 | 25 | nativeBuildInputs = [ 26 | intltool 27 | glib 28 | gobject-introspection 29 | xvfb-run 30 | wrapGAppsHook 31 | ]; 32 | 33 | buildInputs = [ 34 | gtk3 35 | mate.mate-menus 36 | mate.mate-panel 37 | ]; 38 | 39 | propagatedBuildInputs = with python3.pkgs; [ 40 | configobj 41 | distutils_extra 42 | pygobject3 43 | pyxdg 44 | setproctitle 45 | xlib 46 | ]; 47 | 48 | postPatch = 49 | # mate-menu hardcodes absolute paths everywhere. Nuke from orbit. 50 | let 51 | replaceAll = x: y: '' 52 | for file in $(grep -rl "${x}"); do 53 | substituteInPlace $file --replace "${x}" "${y}" 54 | done 55 | ''; 56 | in 57 | # For translations. 58 | replaceAll "/usr/share/locale" "$out/share/locale" 59 | # For mate-menu.py and mate-menu-config.py. 60 | + replaceAll "/usr/lib/mate-menu" "$out/lib/mate-menu" 61 | + replaceAll "'/','usr','lib','mate-menu'" "'$out','lib','mate-menu'" 62 | + '' 63 | substituteInPlace lib/mate-menu.py --replace '"/", "usr", "lib", "mate-menu"' '"${placeholder "out"}", "lib", "mate-menu"' 64 | '' 65 | # For glade files and search suggestion icons. 66 | + replaceAll "/usr/share/mate-menu" "$out/share/mate-menu" 67 | + replaceAll "'/', 'usr', 'share', 'mate-menu'" "'$out', 'share', 'mate-menu'" 68 | + replaceAll "'/','usr','share','mate-menu'" "'$out','share','mate-menu'" 69 | # For desktop entries. 70 | + replaceAll "/usr/share/applications" "/run/current-system/sw/share/applications" 71 | # For editProcess. 72 | + replaceAll "/usr/bin/mate-desktop-item-edit" "${mate.mate-panel}/bin/mate-desktop-item-edit"; 73 | 74 | postInstall = '' 75 | glib-compile-schemas $out/share/glib-2.0/schemas 76 | 77 | # The latter directly calls the former. We prefer the properly wrapped one. 78 | substituteInPlace $out/share/dbus-1/services/org.mate.panel.applet.MateMenuAppletFactory.service \ 79 | $out/share/mate-panel/applets/org.mate.panel.MateMenuApplet.mate-panel-applet \ 80 | --replace "$out/lib/mate-menu/mate-menu.py" "$out/bin/mate-menu" 81 | ''; 82 | 83 | dontWrapGApps = true; 84 | 85 | preFixup = '' 86 | buildPythonPath "$out $propagatedBuildInputs" 87 | patchPythonScript "$out/lib/mate-menu/mate-menu.py" 88 | patchPythonScript "$out/lib/mate-menu/mate-menu-config.py" 89 | 90 | makeWrapperArgs+=("''${gappsWrapperArgs[@]}") 91 | ''; 92 | 93 | checkPhase = '' 94 | runHook preCheck 95 | 96 | HOME=$TMPDIR xvfb-run -s '-screen 0 800x600x24' ${python3.interpreter} nix_run_setup test 97 | 98 | runHook postCheck 99 | ''; 100 | 101 | pythonImportsCheck = [ "mate_menu" ]; 102 | 103 | meta = with lib; { 104 | description = "Advanced menu for the MATE desktop, fork of MintMenu"; 105 | homepage = "https://github.com/ubuntu-mate/mate-menu"; 106 | changelog = "https://github.com/ubuntu-mate/mate-menu/releases/tag/${version}"; 107 | license = licenses.gpl2Plus; 108 | platforms = platforms.linux; 109 | maintainers = [ ]; 110 | }; 111 | } 112 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1745672227, 6 | "narHash": "sha256-oviXvf0xIsfkhKv+lCY62ml822nI64ZaPC+SfIJ7a5I=", 7 | "ref": "upd/xfce", 8 | "rev": "773d6c4ce73bce15ced79371f88c4fb5db960122", 9 | "revCount": 788137, 10 | "type": "git", 11 | "url": "file:///home/bobby285271/nixpkgs" 12 | }, 13 | "original": { 14 | "ref": "nixos-unstable", 15 | "type": "git", 16 | "url": "file:///home/bobby285271/nixpkgs" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "nixos-bobby285271"; 3 | 4 | inputs.nixpkgs.url = "git+file:///home/bobby285271/nixpkgs?ref=nixos-unstable"; 5 | 6 | outputs = 7 | { self, nixpkgs, ... }@inputs: 8 | let 9 | system = "x86_64-linux"; 10 | in 11 | { 12 | packages.system = import ./packages.nix { pkgs = nixpkgs.legacyPackages.system; }; 13 | nixosConfigurations = import ./profiles.nix { inherit inputs system; }; 14 | # nix build '/path/to/flake#iso' 15 | # Takes ~1h to build on my laptop 16 | legacyPackages.system = { 17 | iso = self.nixosConfigurations.iso.config.system.build.isoImage; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /helper/__internal-update-common.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then 6 | echo -e "\033[36m🛠️ Usage: __internal-update-common.sh \$profile \$checkout\033[0m" 7 | false 8 | fi 9 | 10 | 11 | nixpkgs_remote="https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git/" 12 | nixpkgs_dir="${HOME}/nixpkgs" 13 | nixos_config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && dirname "$(pwd)")" 14 | 15 | echo -e "\033[36m🛠️ Updating nixpkgs checkout\033[0m" 16 | cd "${nixpkgs_dir}" 17 | 18 | git fetch ${nixpkgs_remote} nixos-unstable:nixos-unstable || true 19 | git fetch ${nixpkgs_remote} master:upstream || true 20 | git fetch ${nixpkgs_remote} staging:staging || true 21 | 22 | echo -e "\n\033[36m🛠️ Updating flake lock\033[0m" 23 | cd "${nixos_config_dir}" 24 | if [ "$#" -eq 1 ]; then 25 | nix flake update --commit-lock-file 26 | else 27 | nix flake update --commit-lock-file --override-input nixpkgs "git+file://${nixpkgs_dir}?ref=${2}" 28 | fi 29 | 30 | 31 | echo -e "\n\033[36m🛠️ Testing profile:\033[0m ${1}" 32 | nixos-rebuild --flake "${nixos_config_dir}#${1}" dry-run --impure 33 | 34 | 35 | echo -e "\n\033[36m🛠️ Building profile:\033[0m ${1}" 36 | sudo nixos-rebuild --flake "${nixos_config_dir}#${1}" boot --impure 37 | 38 | 39 | echo -e "\n\033[36m🛠️ Updating channel\033[0m" 40 | sudo nix-channel --update 41 | 42 | exit 0 43 | -------------------------------------------------------------------------------- /helper/gh-hosts-generator.cpp: -------------------------------------------------------------------------------- 1 | #if 0 2 | clear 3 | g++ -std=c++14 -O2 -Wall -lm "$0" -o gh-hosts-generator.out && ./gh-hosts-generator.out 4 | rm -f ./gh-hosts-generator.out 5 | exit 6 | #endif 7 | 8 | // You won't need this. 9 | // https://github.com/521xueweihan/GitHub520 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | std::map> mp; 17 | const int INDCNT = 6; 18 | const int EXTRAINDCNT = 2; 19 | 20 | std::string getprefix(int indcnt) 21 | { 22 | std::string ret; 23 | while (indcnt--) 24 | { 25 | ret += ' '; 26 | } 27 | return ret; 28 | } 29 | 30 | std::string wrapstring(std::string ori) 31 | { 32 | std::string ret = "\"" + ori + "\""; 33 | return ret; 34 | } 35 | 36 | int main() 37 | { 38 | std::cout << "Input raw data:" << std::endl; 39 | std::string k, v; 40 | while (std::cin >> k >> v) 41 | { 42 | mp[k].push_back(v); 43 | } 44 | for (auto &k : mp) 45 | { 46 | std::cout << getprefix(INDCNT) << wrapstring(k.first) << " = ["; 47 | if (k.second.size() == 1) 48 | { 49 | std::cout << " " << wrapstring(k.second[0]) << " ];" << std::endl; 50 | } 51 | else 52 | { 53 | std::cout << std::endl; 54 | for (auto &v : k.second) 55 | { 56 | std::cout << getprefix(INDCNT + EXTRAINDCNT) << wrapstring(v) << std::endl; 57 | } 58 | std::cout << getprefix(INDCNT) << "];" << std::endl; 59 | } 60 | } 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /helper/nix-daemon-proxy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo mkdir /run/systemd/system/nix-daemon.service.d/ 4 | sudo echo "[Service]" > /run/systemd/system/nix-daemon.service.d/override.conf 5 | sudo echo 'Environment="http_proxy=http://localhost:20172"' >> /run/systemd/system/nix-daemon.service.d/override.conf 6 | sudo echo 'Environment="https_proxy=http://localhost:20172"' >> /run/systemd/system/nix-daemon.service.d/override.conf 7 | sudo echo 'Environment="all_proxy=http://localhost:20172"' >> /run/systemd/system/nix-daemon.service.d/override.conf 8 | sudo systemctl daemon-reload 9 | sudo systemctl restart nix-daemon 10 | -------------------------------------------------------------------------------- /helper/non-xfce-autostart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | gsettings reset-recursively org.gnome.desktop.wm.preferences || true 3 | gsettings reset-recursively org.gnome.settings-daemon.plugins.xsettings || true 4 | for i in icon-theme gtk-theme cursor-size cursor-theme clock-show-date; do 5 | gsettings reset org.gnome.desktop.interface $i || true 6 | done 7 | 8 | sudo bash /home/bobby285271/nixos/helper/nix-daemon-proxy.sh 9 | -------------------------------------------------------------------------------- /helper/test-gnome.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | nixos_config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && dirname "$(pwd)")" 4 | 5 | cd ${nixos_config_dir} 6 | 7 | rm -f desktop/{firefox,fonts,packages}.nix 8 | rm -f system/{lamp,python,virtualisation}.nix 9 | -------------------------------------------------------------------------------- /helper/xfce-autostart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | gsettings set org.gnome.desktop.interface gtk-theme "Greybird" 4 | gsettings set org.gnome.desktop.interface icon-theme "elementary-xfce-hidpi" 5 | gsettings set org.gnome.desktop.interface clock-show-date false 6 | 7 | if [ $XDG_SESSION_TYPE = "wayland" ]; then 8 | xfconf-query -c displays -n -t double -p "/Default/eDP-1/Scale" -s 2.0000 9 | xfconf-query -c xsettings -n -t int -p "/Gdk/WindowScalingFactor" -s 1 10 | gsettings set org.gnome.desktop.interface cursor-size 24 11 | echo 'Xft.dpi:96' | xrdb -merge 12 | systemctl --user import-environment DISPLAY WAYLAND_DISPLAY DBUS_SESSION_BUS_ADDRESS XDG_SESSION_ID 13 | # wlr-randr --output eDP-1 --scale 2 14 | else 15 | xfconf-query -c displays -n -t double -p "/Default/eDP-1/Scale" -s 1.0000 16 | xfconf-query -c xfwm4 -n -t string -p "/general/theme" -s Default-xhdpi 17 | xfconf-query -c xsettings -n -t int -p "/Gdk/WindowScalingFactor" -s 2 18 | gsettings set org.gnome.desktop.interface cursor-size 48 19 | echo 'Xft.dpi:192' | xrdb -merge 20 | fi 21 | 22 | xfconf-query --create --type string -c displays -p /Schemes/Apply -s Default 23 | 24 | sudo bash /home/bobby285271/nixos/helper/nix-daemon-proxy.sh 25 | -------------------------------------------------------------------------------- /machines/iso/default.nix: -------------------------------------------------------------------------------- 1 | { modulesPath, ... }: 2 | 3 | { 4 | imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-graphical-base.nix" ]; 5 | } 6 | -------------------------------------------------------------------------------- /machines/laptop/boot.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | boot = { 5 | # kernelPackages = pkgs.linuxPackages_latest; 6 | # kernelPackages = pkgs.linuxKernel.packages.linux_6_5; 7 | # plymouth.enable = true; 8 | loader = { 9 | timeout = 10; 10 | efi.canTouchEfiVariables = true; 11 | systemd-boot = { 12 | enable = true; 13 | configurationLimit = 5; 14 | consoleMode = "max"; 15 | }; 16 | }; 17 | }; 18 | 19 | services.xserver.videoDrivers = [ "nvidia" ]; 20 | 21 | hardware.nvidia = { 22 | open = true; 23 | prime = { 24 | offload = { 25 | enable = true; 26 | enableOffloadCmd = true; 27 | }; 28 | intelBusId = "PCI:0:2:0"; 29 | nvidiaBusId = "PCI:1:0:0"; 30 | }; 31 | }; 32 | 33 | networking.hostName = "thinkbook"; 34 | zramSwap.enable = true; 35 | 36 | environment.variables."NIXPKGS_NO_GC_PATH" = [ 37 | # "${pkgs.linuxPackages_latest.nvidia_x11.src}" 38 | # "${pkgs.linuxKernel.packages.linux_6_5.nvidia_x11.src}" 39 | ]; 40 | } 41 | -------------------------------------------------------------------------------- /machines/laptop/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | let 4 | folder = ./.; 5 | toImport = name: value: folder + ("/" + name); 6 | filterConfig = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; 7 | imports = lib.mapAttrsToList toImport (lib.filterAttrs filterConfig (builtins.readDir folder)); 8 | in 9 | { 10 | inherit imports; 11 | } 12 | -------------------------------------------------------------------------------- /machines/laptop/hardware.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | modulesPath, 5 | ... 6 | }: 7 | 8 | { 9 | imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 10 | 11 | boot = { 12 | initrd = { 13 | availableKernelModules = [ 14 | "xhci_pci" 15 | "ahci" 16 | "nvme" 17 | "usbhid" 18 | "usb_storage" 19 | "sd_mod" 20 | ]; 21 | kernelModules = [ ]; 22 | }; 23 | kernelModules = [ "kvm-intel" ]; 24 | extraModulePackages = [ ]; 25 | }; 26 | 27 | fileSystems = { 28 | "/" = { 29 | device = "/dev/disk/by-uuid/d094ad99-0754-413e-9f4b-47153bc9775b"; 30 | fsType = "btrfs"; 31 | options = [ 32 | "subvol=@" 33 | "compress=zstd" 34 | ]; 35 | }; 36 | "/home" = { 37 | device = "/dev/disk/by-uuid/d094ad99-0754-413e-9f4b-47153bc9775b"; 38 | fsType = "btrfs"; 39 | options = [ 40 | "subvol=@home" 41 | "compress=zstd" 42 | ]; 43 | }; 44 | "/nix" = { 45 | device = "/dev/disk/by-uuid/d094ad99-0754-413e-9f4b-47153bc9775b"; 46 | fsType = "btrfs"; 47 | options = [ 48 | "subvol=@nix" 49 | "compress=zstd" 50 | "noatime" 51 | ]; 52 | }; 53 | "/boot" = { 54 | device = "/dev/disk/by-uuid/761F-0A47"; 55 | fsType = "vfat"; 56 | options = [ "fmask=0022" "dmask=0022" ]; 57 | }; 58 | }; 59 | 60 | # swapDevices = [ { device = "/dev/disk/by-uuid/40b4055b-f484-4550-87fe-442bac5f5176"; } ]; 61 | 62 | networking.useDHCP = lib.mkDefault true; 63 | # powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 64 | hardware.cpu.intel.updateMicrocode = true; 65 | } 66 | -------------------------------------------------------------------------------- /machines/laptop/nixconfig.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix = { 3 | registry.nixpkgs = { 4 | from = { 5 | type = "indirect"; 6 | id = "local"; 7 | }; 8 | to = { 9 | type = "git"; 10 | ref = "nixos-unstable"; 11 | url = "file:///home/bobby285271/nixpkgs"; 12 | }; 13 | }; 14 | 15 | settings.trusted-users = [ 16 | "root" 17 | "bobby285271" 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /machines/laptop/scripts.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | let 4 | desktops = [ 5 | "budgie" 6 | "cinnamon" 7 | "gnome" 8 | "labwc" 9 | "lxqt" 10 | "mate" 11 | "pantheon" 12 | "xfce" 13 | ]; 14 | in 15 | { 16 | environment.systemPackages = 17 | [ 18 | (pkgs.writeShellScriptBin "review.sh" '' 19 | cd /home/bobby285271/nixpkgs 20 | git fetch https://github.com/nixos/nixpkgs pull/''${1}/head 21 | git checkout FETCH_HEAD 22 | '') 23 | (pkgs.writeShellScriptBin "tape.sh" '' 24 | nix run /home/bobby285271/nonemast --override-input nixpkgs \ 25 | 'git+file:///home/bobby285271/nixpkgs?ref=nixos-unstable' -- "$@" 26 | '') 27 | ] 28 | ++ (map ( 29 | desktop: 30 | pkgs.writeShellScriptBin "nixos-${desktop}.sh" '' 31 | /home/bobby285271/nixos/helper/__internal-update-common.sh "laptop-${desktop}" "$@" 32 | '' 33 | ) desktops); 34 | } 35 | -------------------------------------------------------------------------------- /packages.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs ? import { }, 3 | }: 4 | { 5 | # Desktop 6 | libreoffice-icon-fixed = pkgs.callPackage ./desktop/pkgs/libreoffice-icon-fixed.nix { }; 7 | dingtalk = pkgs.callPackage ./desktop/pkgs/dingtalk { }; 8 | mate-menu = pkgs.callPackage ./desktop/pkgs/mate-menu.nix { }; 9 | } 10 | -------------------------------------------------------------------------------- /profiles.nix: -------------------------------------------------------------------------------- 1 | { inputs, system, ... }: 2 | 3 | let 4 | specialArgs = { 5 | inherit inputs system; 6 | }; 7 | 8 | sharedModules = [ 9 | ./desktop 10 | ./system 11 | ]; 12 | laptopSharedModules = sharedModules ++ [ 13 | ./machines/laptop 14 | ./users/bobby285271 15 | ./users/misc 16 | ]; 17 | # https://github.com/NixOS/nixpkgs/blob/23.11/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh#L359 18 | oneOfTheDesktopsBobbyUses = [ ./desktop/candidates/xfce.nix ]; 19 | in 20 | { 21 | laptop-cinnamon = inputs.nixpkgs.lib.nixosSystem { 22 | inherit system specialArgs; 23 | modules = [ ./desktop/candidates/cinnamon.nix ] ++ laptopSharedModules; 24 | }; 25 | laptop-pantheon = inputs.nixpkgs.lib.nixosSystem { 26 | inherit system specialArgs; 27 | modules = [ ./desktop/candidates/pantheon.nix ] ++ laptopSharedModules; 28 | }; 29 | laptop-mate = inputs.nixpkgs.lib.nixosSystem { 30 | inherit system specialArgs; 31 | modules = [ ./desktop/candidates/mate.nix ] ++ laptopSharedModules; 32 | }; 33 | laptop-gnome = inputs.nixpkgs.lib.nixosSystem { 34 | inherit system specialArgs; 35 | modules = [ ./desktop/candidates/gnome.nix ] ++ laptopSharedModules; 36 | }; 37 | laptop-budgie = inputs.nixpkgs.lib.nixosSystem { 38 | inherit system specialArgs; 39 | modules = [ ./desktop/candidates/budgie.nix ] ++ laptopSharedModules; 40 | }; 41 | laptop-xfce = inputs.nixpkgs.lib.nixosSystem { 42 | inherit system specialArgs; 43 | modules = [ ./desktop/candidates/xfce.nix ] ++ laptopSharedModules; 44 | }; 45 | laptop-labwc = inputs.nixpkgs.lib.nixosSystem { 46 | inherit system specialArgs; 47 | modules = [ ./desktop/candidates/labwc.nix ] ++ laptopSharedModules; 48 | }; 49 | laptop-lxqt = inputs.nixpkgs.lib.nixosSystem { 50 | inherit system specialArgs; 51 | modules = [ ./desktop/candidates/lxqt.nix ] ++ laptopSharedModules; 52 | }; 53 | thinkbook = inputs.nixpkgs.lib.nixosSystem { 54 | inherit system specialArgs; 55 | modules = oneOfTheDesktopsBobbyUses ++ laptopSharedModules; 56 | }; 57 | iso = inputs.nixpkgs.lib.nixosSystem { 58 | inherit system specialArgs; 59 | modules = [ ./machines/iso ] ++ oneOfTheDesktopsBobbyUses ++ sharedModules; 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /system/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | 3 | let 4 | folder = ./.; 5 | toImport = name: value: folder + ("/" + name); 6 | filterConfig = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; 7 | imports = lib.mapAttrsToList toImport (lib.filterAttrs filterConfig (builtins.readDir folder)); 8 | in 9 | { 10 | inherit imports; 11 | } 12 | -------------------------------------------------------------------------------- /system/git.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.git = { 3 | enable = true; 4 | config = { 5 | init.defaultBranch = "master"; 6 | core.compression = 0; 7 | http.postBuffer = 1048576000; 8 | protocol."https".allow = "always"; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /system/lamp.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services = { 5 | mysql = { 6 | enable = true; 7 | package = pkgs.mariadb; 8 | }; 9 | httpd = { 10 | enable = true; 11 | adminAddr = "admin@bobby285271.top"; 12 | virtualHosts.localhost.documentRoot = "/srv/html"; 13 | # enablePHP = true; 14 | }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /system/locale.nix: -------------------------------------------------------------------------------- 1 | { 2 | i18n = { 3 | defaultLocale = "zh_CN.UTF-8"; 4 | supportedLocales = [ 5 | "zh_CN.UTF-8/UTF-8" 6 | "en_US.UTF-8/UTF-8" 7 | "ja_JP.UTF-8/UTF-8" 8 | ]; 9 | }; 10 | 11 | time.timeZone = "Asia/Shanghai"; 12 | 13 | # Test https://github.com/NixOS/nixpkgs/issues/238025 14 | environment.sessionVariables."TZ" = "Asia/Shanghai"; 15 | 16 | location = { 17 | latitude = 23.0; 18 | longitude = 113.0; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /system/misc.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, ... }: 2 | 3 | { 4 | environment = { 5 | # enableDebugInfo = true; 6 | localBinInPath = true; 7 | }; 8 | 9 | services = { 10 | openssh.enable = true; 11 | thermald.enable = true; 12 | printing.enable = true; 13 | power-profiles-daemon.enable = true; 14 | # tlp.enable = true; 15 | pipewire = { 16 | enable = true; 17 | # systemWide = true; 18 | alsa.enable = true; 19 | alsa.support32Bit = true; 20 | pulse.enable = true; 21 | jack.enable = true; 22 | wireplumber.enable = true; 23 | }; 24 | # mpd = { 25 | # enable = true; 26 | # extraConfig = '' 27 | # auto_update "yes" 28 | 29 | # audio_output { 30 | # type "pipewire" 31 | # name "pipewire" 32 | # } 33 | # ''; 34 | # }; 35 | }; 36 | # hardware.pulseaudio.enable = false; 37 | 38 | system.stateVersion = "23.11"; 39 | } 40 | -------------------------------------------------------------------------------- /system/network.nix: -------------------------------------------------------------------------------- 1 | { 2 | services = { 3 | avahi = { 4 | enable = true; 5 | publish.enable = true; 6 | publish.userServices = true; 7 | }; 8 | 9 | v2raya.enable = true; 10 | }; 11 | 12 | networking = { 13 | networkmanager.enable = true; 14 | firewall = { 15 | allowedTCPPorts = [ 16 | 80 17 | 443 18 | 5353 19 | 8080 20 | 42000 21 | 42001 22 | 11694 23 | ]; 24 | allowedTCPPortRanges = [ 25 | { 26 | from = 1714; 27 | to = 1764; # KDE connect 28 | } 29 | ]; 30 | }; 31 | # nameservers = [ 32 | # "119.29.29.29" 33 | # "223.5.5.5" 34 | # ]; 35 | hosts = { 36 | # GitHub 37 | "13.107.253.40" = [ "vscode.dev" ]; 38 | "13.107.42.16" = [ "pipelines.actions.githubusercontent.com" ]; 39 | "140.82.112.18" = [ "github.community" ]; 40 | "140.82.112.21" = [ "collector.github.com" ]; 41 | "140.82.112.26" = [ "alive.github.com" ]; 42 | "140.82.112.3" = [ "github.com" ]; 43 | "140.82.112.9" = [ "codeload.github.com" ]; 44 | "140.82.113.21" = [ "central.github.com" ]; 45 | "140.82.113.4" = [ "gist.github.com" ]; 46 | "140.82.113.5" = [ "api.github.com" ]; 47 | "140.82.114.21" = [ "education.github.com" ]; 48 | "140.82.114.25" = [ "live.github.com" ]; 49 | "151.101.1.194" = [ "github.global.ssl.fastly.net" ]; 50 | "185.199.110.153" = [ 51 | "assets-cdn.github.com" 52 | "github.io" 53 | "githubstatus.com" 54 | ]; 55 | "185.199.110.154" = [ "github.githubassets.com" ]; 56 | "185.199.111.133" = [ 57 | "avatars.githubusercontent.com" 58 | "avatars0.githubusercontent.com" 59 | "avatars1.githubusercontent.com" 60 | "avatars2.githubusercontent.com" 61 | "avatars3.githubusercontent.com" 62 | "avatars4.githubusercontent.com" 63 | "avatars5.githubusercontent.com" 64 | "camo.githubusercontent.com" 65 | "cloud.githubusercontent.com" 66 | "desktop.githubusercontent.com" 67 | "favicons.githubusercontent.com" 68 | "github.map.fastly.net" 69 | "media.githubusercontent.com" 70 | "objects.githubusercontent.com" 71 | "raw.githubusercontent.com" 72 | "user-images.githubusercontent.com" 73 | ]; 74 | "192.0.66.2" = [ "github.blog" ]; 75 | "52.216.210.129" = [ "github-production-release-asset-2e65be.s3.amazonaws.com" ]; 76 | "52.216.216.209" = [ "github-production-repository-file-5c1aeb.s3.amazonaws.com" ]; 77 | "52.217.201.217" = [ "github-cloud.s3.amazonaws.com" ]; 78 | "52.217.71.76" = [ "github-com.s3.amazonaws.com" ]; 79 | "54.231.132.97" = [ "github-production-user-asset-6210df.s3.amazonaws.com" ]; 80 | # Cachix 81 | "104.26.13.82" = [ "nix-community.cachix.org" ]; 82 | # ???? 83 | "104.244.42.69" = [ "t.co" ]; 84 | }; 85 | }; 86 | } 87 | -------------------------------------------------------------------------------- /system/nixconfig.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, ... }: 2 | 3 | { 4 | nix = { 5 | # package = pkgs.lix; 6 | settings = { 7 | experimental-features = [ 8 | "nix-command" 9 | "flakes" 10 | ]; 11 | auto-optimise-store = true; 12 | flake-registry = "${./registry.json}"; 13 | # substituters = lib.mkForce [ 14 | substituters = [ 15 | "https://mirrors.ustc.edu.cn/nix-channels/store" 16 | "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" 17 | # "https://bobby285271.cachix.org" 18 | ]; 19 | # trusted-public-keys = [ 20 | # "bobby285271.cachix.org-1:suZrwf/wphZbNXocjgcc49lcn/RB0iFxlh1peSVOE3w=" 21 | # ]; 22 | }; 23 | }; 24 | 25 | nixpkgs.config = { 26 | allowUnfree = true; 27 | allowAliases = true; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /system/packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | environment.systemPackages = with pkgs; [ 5 | cachix 6 | distrobox 7 | dos2unix 8 | gcc 9 | gdb 10 | gh 11 | git 12 | gnumake 13 | gnupg 14 | gptfdisk 15 | # kubectl 16 | # minikube 17 | nix-update 18 | nixfmt-rfc-style 19 | nixpkgs-review 20 | ntfs3g 21 | # openjdk 22 | p7zip 23 | pciutils 24 | pinentry-curses 25 | tree 26 | unrar 27 | unzip 28 | vim 29 | wget 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /system/python.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | let 4 | my-python-packages = 5 | python3Packages: with pkgs.python3Packages; [ 6 | autopep8 7 | boto3 8 | gitpython 9 | pandas 10 | pip 11 | requests 12 | ]; 13 | python-with-my-packages = pkgs.python3.withPackages my-python-packages; 14 | in 15 | { 16 | environment.systemPackages = with pkgs; [ python-with-my-packages ]; 17 | } 18 | -------------------------------------------------------------------------------- /system/registry.json: -------------------------------------------------------------------------------- 1 | { 2 | "flakes": [ 3 | { 4 | "from": { 5 | "id": "nixpkgs", 6 | "type": "indirect" 7 | }, 8 | "to": { 9 | "type": "tarball", 10 | "url": "https://mirrors.ustc.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz" 11 | } 12 | } 13 | ], 14 | "version": 2 15 | } -------------------------------------------------------------------------------- /system/virtualisation.nix: -------------------------------------------------------------------------------- 1 | { 2 | virtualisation = { 3 | podman = { 4 | enable = true; 5 | dockerCompat = true; 6 | dockerSocket.enable = true; 7 | }; 8 | libvirtd.enable = true; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /system/zsh.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | programs = { 5 | zsh = { 6 | enable = true; 7 | autosuggestions.enable = true; 8 | ohMyZsh = { 9 | enable = true; 10 | theme = "ys"; 11 | plugins = [ 12 | "git" 13 | "python" 14 | "man" 15 | ]; 16 | }; 17 | }; 18 | thefuck.enable = true; 19 | bash.completion.enable = true; 20 | }; 21 | 22 | environment = { 23 | shells = [ 24 | pkgs.bashInteractive 25 | pkgs.zsh 26 | ]; 27 | shellInit = '' 28 | export GPG_TTY="$(tty)" 29 | ''; 30 | }; 31 | 32 | users.defaultUserShell = pkgs.zsh; 33 | } 34 | -------------------------------------------------------------------------------- /users/bobby285271/default.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: 2 | 3 | { 4 | users.users.bobby285271 = { 5 | isNormalUser = true; 6 | hashedPassword = "$6$0MOOo3w4xnwaTK07$us6355WMS/QG.TDsY1qfiK3vhSEQo1pfsx0xEWzLMD/9A/mOty889pr5XGFGYOeJoNbVLCk/DgBxq7g5JPJsh1"; 7 | home = "/home/bobby285271"; 8 | description = "Bobby Rong"; 9 | extraGroups = [ 10 | "wheel" 11 | "networkmanager" 12 | "docker" 13 | "podman" 14 | "audio" 15 | "sound" 16 | "video" 17 | "networkmanager" 18 | "input" 19 | "tty" 20 | "camera" 21 | "pipewire" 22 | ]; 23 | }; 24 | 25 | security.sudo.extraRules = [ 26 | { 27 | users = [ "bobby285271" ]; 28 | commands = [ 29 | { 30 | command = "ALL"; 31 | options = [ "NOPASSWD" ]; 32 | } 33 | ]; 34 | } 35 | ]; 36 | 37 | system.activationScripts.setUserImages.text = 38 | if config.services.xserver.desktopManager.cinnamon.enable then 39 | '' 40 | rm -f /var/lib/AccountsService/icons/bobby285271 41 | '' 42 | else 43 | '' 44 | if test -f /var/lib/AccountsService/icons/bobby285271.default; then 45 | cp -f /var/lib/AccountsService/icons/bobby285271{.default,} 46 | fi 47 | ''; 48 | } 49 | -------------------------------------------------------------------------------- /users/misc/default.nix: -------------------------------------------------------------------------------- 1 | { config, ... }: 2 | 3 | { 4 | # users.users.${config.services.mpd.user}.extraGroups = [ 5 | # "sound" 6 | # "pipewire" 7 | # "audio" 8 | # ]; 9 | } 10 | --------------------------------------------------------------------------------