fix up sway config a bit, add more nixos-live options

This commit is contained in:
chaos 2023-08-29 14:07:17 +01:00
parent 7e4f414ea6
commit d65608c9b2
No known key found for this signature in database
19 changed files with 233 additions and 38 deletions

View file

@ -1,5 +1,21 @@
{pkgs, ...}: {
home.packages = with pkgs; [rofi];
{
pkgs,
nixosConfig,
...
}: let
gnomeConfig = nixosConfig.services.xserver.desktopManager.gnome;
gdmConfig = nixosConfig.services.xserver.displayManager.gdm;
isGnome = gnomeConfig.enable;
isGDMWayland = gdmConfig.enable && gdmConfig.wayland;
isWayland = isGnome && isGDMWayland;
# rofi currently does not run on gnome
rofiPackage = pkgs.rofi;
in {
home.packages = [rofiPackage];
home.file.".local/share/rofi/themes/rofi-nord.rasi".source = ./rofi-nord.rasi;
home.file.".config/rofi/config.rasi".source = ./config.rasi;
}

View file

@ -1,5 +1,5 @@
{...}: {
programs.mako = {
services.mako = {
enable = true;
defaultTimeout = 3000;
};

View file

@ -21,6 +21,18 @@
QT_AUTO_SCREEN_SCALE_FACTOR = 1;
};
home.pointerCursor = {
package = pkgs.gnome.adwaita-icon-theme;
name = "Adwaita";
size = 24;
gtk.enable = true;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
};
home.packages = with pkgs; [
grim
slurp
@ -34,8 +46,6 @@
libdbusmenu-gtk3
];
xdg.dataFile."wallpaper.jpg".source = ./wallpaper.jpg;
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.base = true;
@ -62,7 +72,7 @@
{command = "${pkgs.waybar}/bin/waybar";}
];
output = {"*" = {bg = "~/.local/share/wallpaper.jpg fill";};};
output = {"*" = {bg = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath} fill";};};
input = {"*" = {xkb_layout = "gb";};};
fonts = {
@ -98,7 +108,7 @@
};
window = {
border = 4;
border = 0;
titlebar = false;
};
@ -125,9 +135,9 @@
"XF86AudioMicMute" = "exec ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec sudo xbacklight -time 1 -dec +5";
"XF86MonBrightnessUp" = "exec sudo xbacklight -time 1 -inc +5";
"Print" = "exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png";
"Shift+Print" = ''
"Print" = ''
exec ${pkgs.grim}/bin/grim -t png -g "$(${pkgs.slurp}/bin/slurp -d)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png'';
"Shift+Print" = "exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png";
"${cfg.modifier}+d" = "exec ${menu}";
"${cfg.modifier}+f" = "fullscreen";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

View file

@ -14,4 +14,31 @@
"Mounts/Temp1"
"Mounts/Temp2"
];
home.file."Music/music-sync.sh" = {
executable = true;
text = ''
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "''${SCRIPT_DIR}"
rclone sync -P . Storage:Music --exclude music-sync.sh,music-download.sh
restic-music backup $(fd -t d --max-depth=1 && fd -t f --max-depth=1)
~/Projects/music_library_website/update.sh
'';
};
home.file."Music/music-download.sh" = {
executable = true;
text = ''
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "''${SCRIPT_DIR}"
rclone sync -P --exclude music-sync.sh,music-download.sh Storage:Music .
'';
};
}

View file

@ -5,7 +5,7 @@
profiles.sshd
profiles.kernels.latest
presets.nixos.desktop
presets.nixos.desktop-sway
presets.nixos.laptop
presets.nixos.encrypted-usb

View file

@ -1,4 +1,5 @@
{
self,
config,
tree,
modulesPath,

View file

@ -1,4 +1,10 @@
{nixpkgs-unstable, ...} @ inputs: let
{
self,
nixpkgs-unstable,
...
} @ inputs: let
inherit (nixpkgs-unstable.lib) forEach;
mkTree = inputs.tree-input.tree;
metaTree = mkTree ((import ../treeConfig.nix {}) // {inherit inputs;});
tree = metaTree.impure;
@ -12,6 +18,7 @@
};
defaultSpecialArgs = {
inherit self;
tree = metaTree.impure;
pureTree = metaTree.pure;
inputs = patchedInputs;
@ -68,6 +75,51 @@ in {
modules = defaultModules ++ [./nixos-live/nixos-live.nix];
};
nixos-live-x86_64-laptops = nixosUnstableSystem {
specialArgs = defaultSpecialArgs;
system = "x86_64-linux";
modules =
defaultModules
++ [
./nixos-live/nixos-live.nix
({...}: {
system.extraDependencies =
forEach ["lappy-t495" "tablet"] (system:
self.nixosConfigurations.${system}.config.system.build.toplevel);
})
];
};
nixos-live-x86_64-servers = nixosUnstableSystem {
specialArgs = defaultSpecialArgs;
system = "x86_64-linux";
modules =
defaultModules
++ [
./nixos-live/nixos-live.nix
({...}: {
system.extraDependencies =
forEach ["vault" "hetzner-vm"] (system:
self.nixosConfigurations.${system}.config.system.build.toplevel);
})
];
};
nixos-live-x86_64-all = nixosUnstableSystem {
specialArgs = defaultSpecialArgs;
system = "x86_64-linux";
modules =
defaultModules
++ [
./nixos-live/nixos-live.nix
({...}: {
system.extraDependencies =
forEach ["lappy-t495" "tablet" "vault" "hetzner-vm"] (system:
self.nixosConfigurations.${system}.config.system.build.toplevel);
})
];
};
# nix --no-sandbox build .#nixosConfigurations.raspberry.config.system.build.sdImage
raspberry = nixosUnstableSystem {
specialArgs = defaultSpecialArgs;

View file

@ -10,6 +10,31 @@
simple_get "/api-keys/music-stream" .password > $secretFile
'';
};
# Required for home.apps.manual-backup-apps
gitlab_archiver_token = {
user = "chaos";
group = "users";
fetchScript = ''
simple_get "/api-keys/gitlab/gitlab_archiver" .token > $secretFile
'';
};
# Required for home.apps.manual-backup-apps
restic_music_env = {
user = "chaos";
group = "users";
fetchScript = ''
api_username=$(simple_get "/api-keys/storage/restic/Music" .username)
api_password=$(simple_get "/api-keys/storage/restic/Music" .password)
restic_password=$(simple_get "/private-public-keys/restic/Music" .password)
echo > $secretFile
echo "RESTIC_REPOSITORY=rest:https://''${api_username}:''${api_password}@storage-restic.owo.monster/Music" >> $secretFile
echo "RESTIC_PASSWORD=''${restic_password}" >> $secretFile
'';
};
};
};
}

View file

@ -5,12 +5,10 @@
profiles.sshd
profiles.kernels.latest
presets.nixos.desktop
presets.nixos.desktop-gnome
presets.nixos.laptop
presets.nixos.encrypted-usb
hosts.tablet.profiles.wireguard
./secrets.nix
];

View file

@ -1 +0,0 @@
_: {}

View file

@ -1 +0,0 @@
_: {}

View file

@ -1,8 +1,12 @@
final: prev: {
comic-sans = final.callPackage ./comic-sans {};
comic-code = final.callPackage ./comic-code {};
gobar = final.callPackage ./gobar {};
roc-toolkit-patched = final.callPackage ./roc-toolkit-patched {};
roc-send-pcm = final.callPackage ./roc-send-pcm {};
piped-backend = final.callPackage ./piped/backend {
jre = final.openjdk19_headless;
jdk = final.openjdk19;

View file

@ -2,17 +2,17 @@
imports = with tree; [
profiles.sound.pipewire
profiles.gui.base
profiles.gui.environments.gnome
profiles.firewall-allow.aria2c
profiles.firewall-allow.soulseek
profiles.mullvad
];
boot.plymouth.enable = true;
home-manager.users.chaos = {
imports = with tree; [
home.gui.base
home.gui.environments.gnome
home.apps.file-roller
home.apps.nautilus

View file

@ -0,0 +1,11 @@
{tree, ...}: {
imports = with tree; [
presets.nixos.desktop-base
profiles.gui.environments.gnome
];
home-manager.users.chaos = {
imports = with tree; [
home.gui.environments.gnome
];
};
}

View file

@ -0,0 +1,11 @@
{tree, ...}: {
imports = with tree; [
presets.nixos.desktop-base
profiles.gui.environments.sway
];
home-manager.users.chaos = {
imports = with tree; [
home.gui.environments.sway
];
};
}

View file

@ -1,9 +1,17 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
gnome3.adwaita-icon-theme
];
fonts = {
packages = with pkgs; [comic-sans comic-code];
fontconfig = {
# For Telegram
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<match>
<test name="family"><string>Open Sans</string></test>
<edit name="family" mode="assign" binding="strong">
@ -16,6 +24,7 @@
<string>Comic Sans MS:style=bold</string>
</edit>
</match>
</fontconfig>
'';
defaultFonts = {
serif = ["Comic Sans MS"];

View file

@ -2,13 +2,39 @@
pkgs,
lib,
...
}: {
}: let
isWayland = true;
in {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
displayManager.gdm.wayland = false;
displayManager.gdm = {
enable = true;
wayland = isWayland;
autoSuspend = false;
};
};
environment.variables = {
QT_QPA_PLATFORM =
if isWayland
then "wayland-egl"
else "xcb";
SDL_VIDEODRIVER =
if isWayland
then "wayland"
else "x11";
_JAVA_AWT_WM_NONREPARENTING = lib.mkIf isWayland "1";
};
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
'';
environment.gnome.excludePackages = [
pkgs.gnome.cheese
pkgs.gnome.gnome-music
@ -25,16 +51,21 @@
pkgs.gnome-tour
pkgs.gnome.geary
];
environment.systemPackages = with pkgs; [
gnomeExtensions.appindicator
gnome.gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.just-perfection
qt5.qtwayland
wl-clipboard
xclip
];
services.gnome.gnome-browser-connector.enable = true;
services.udev.packages = with pkgs; [gnome3.gnome-settings-daemon];
services.power-profiles-daemon.enable = lib.mkForce false;
services.power-profiles-daemon.enable = true;
hardware.pulseaudio.enable = lib.mkForce false;
programs.dconf.enable = true;

View file

@ -1,7 +1,9 @@
{...}: {
programs.sway.enable = true;
programs.xwayland.enable = true;
#services.xserver.enable = true;
#systemd.services.display-manager.enable = true;
#services.xserver.displayManager.sddm.enable = true;
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
};
}