Update sway config and flake.nix

This commit is contained in:
2024-06-07 18:47:10 -05:00
parent 76e3492a30
commit 4a914da23e
14 changed files with 122 additions and 117 deletions

View File

@@ -1,26 +0,0 @@
{ lib, pkgs, localPackages, ... }: {
imports = [];
environment.systemPackages = with pkgs; [
curl
wget
git
killall
vim
eza
ripgrep
fzf
ncdu
btop
nil
];
programs.neovim = {
enable = true;
defaultEditor = true;
};
programs.fish.enable = true;
}

View File

@@ -1,13 +0,0 @@
{ lib, pkgs, localPackages, ... }: {
environment.systemPackages = with pkgs; with localPackages.x86_64-linux; [
protonup-qt
vesktop
lutris
gamescope-old
wine
];
programs.steam = {
enable = true;
};
}

View File

@@ -1,33 +0,0 @@
{ lib, pkgs, localPackages, ... }: {
environment.systemPackages = with pkgs; with localPackages.x86_64-linux; [
wl-clipboard
grim
slurp
swaybg
waybar
alacritty
kickoff
kickoff-dot-desktop
wayland-pipewire-idle-inhibit
firefox
mpv
cinny-desktop
thunderbird
protonmail-bridge
libsecret
];
programs.sway.enable = true;
programs.thunar.enable = true;
programs.dconf.enable = true;
services.gnome.gnome-keyring.enable = true;
services.dbus.packages = [ pkgs.gnome.seahorse ];
xdg.portal.wlr.enable = true;
fonts.packages = with pkgs; [
font-awesome
];
}

View File

@@ -1,5 +0,0 @@
{ lib, pkgs, localPackages, ... }:
{
programs.light.enable = true;
}

View File

@@ -1,8 +0,0 @@
{ lib, pkgs, localPackages, ... }: {
environment.systemPackages = with pkgs; [
ldns
wireguard-tools
];
}

38
flake.lock generated
View File

@@ -2,8 +2,8 @@
"nodes": {
"currentSystem": {
"locked": {
"lastModified": 1717720375,
"narHash": "sha256-nbltg3gor6ZPWg1zQXGAgIHqJ05lfvJmwaJRjI+HYws=",
"lastModified": 1717721450,
"narHash": "sha256-V2OISNdFOCaFrUjA6fLVe3HsZC9nn7vMjGfhKSHTRIk=",
"path": "/etc/nixos/hostname",
"type": "path"
},
@@ -12,6 +12,24 @@
"type": "path"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -51,9 +69,25 @@
"root": {
"inputs": {
"currentSystem": "currentSystem",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@@ -3,15 +3,21 @@
inputs = {
currentSystem.url = "path:/etc/nixos/hostname";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, currentSystem, nixpkgs, home-manager, ... }: let
outputs = inputs@{ self, currentSystem, nixpkgs, home-manager, flake-utils, ... }: let
inherit (self) outputs;
inherit (currentSystem) hostname;
hostname = currentSystem.hostname;
overlays = import ./overlays;
utils = import ./utils;
configs."ankaa" = {
system = "x86_64-linux";
@@ -79,7 +85,10 @@
common.nil.enable = true;
networking.wireguard.enable = true;
networking = {
wireguard.enable = true;
nameservers = [ "192.168.0.100" ];
};
};
@@ -90,10 +99,8 @@
audio = {
pipewire.enable = true;
music.enable = true;
};
gui = {
enable = true;
protonmail = true;
@@ -114,22 +121,28 @@
common.nil.enable = true;
networking.wireguard.enable = true;
networking = {
wireguard.enable = true;
nameservers = [ "192.168.0.100" ];
};
};
configs."default-hostname" = {
};
configs."default-hostname" = {};
utils = import ./utils;
system = configs."${hostname}".system;
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
overlays = with overlays; [ gamescope ];
config.allowUnfree = true;
};
in {
nixosConfigurations = {
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit (outputs) localPackages;
inherit pkgs;
};
modules = [
{
@@ -153,7 +166,7 @@
];
};
};
localPackages = nixpkgs.lib.genAttrs [ "x86_64-linux" ] (system:
localPackages = pkgs.lib.genAttrs flake-utils.lib.defaultSystems (system:
{
kickoff-dot-desktop = pkgs.callPackage ./pkgs/kickoff-dot-desktop.nix {};
gamescope-old = pkgs.callPackage ./pkgs/gamescope-old {};

View File

@@ -10,19 +10,16 @@
...
}: {
nixpkgs = {
overlays = [];
config = {
allowUnfree = true;
};
};
nix = {
settings = {
experimental-features = "nix-command flakes";
};
};
hardware.opengl.extraPackages = with pkgs; [
rocmPackages.clr.icd
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

View File

@@ -12,6 +12,17 @@ with lib; let
in
{
config = mkIf gui.sway.enable {
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 600;
command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
}
];
};
wayland.windowManager.sway = {
enable = true;
checkConfig = false;
@@ -26,6 +37,7 @@ in
"XF86AudioPause" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
"${modifier}+space" = "exec \"kickoff-dot-desktop | ${pkgs.kickoff}/bin/kickoff --from-stdin --stdout | xargs -d '\\n' ${pkgs.sway}/bin/swaymsg exec\"";
"${modifier}+Return" = "exec alacritty ";
"${modifier}+Control+f" = "exec MOZ_ENABLE_WAYLAND=1 firefox";
"${modifier}+Control+s" = "exec steam";
@@ -54,11 +66,12 @@ in
"${modifier}+Shift+Right" = "move right";
"${modifier}+b" = "split h";
"${modifier}+v" = "split v";
"${modifier}+r" = "mode 'resize'";
"${modifier}+f" = "fullscreen toggle";
"${modifier}+Shift+space" = "floating toggle";
"${modifier}+s" = "layout stacking";
"${modifier}+w" = "layout tabbed";
"${modifier}+e" = "layout toggle split";
"${modifier}+Shift+space" = "floating toggle";
"${modifier}+a" = "focus parent";
"${modifier}+1" = "workspace 1 ";
"${modifier}+2" = "workspace 2";
@@ -82,12 +95,9 @@ in
"${modifier}+Shift+0" = "move container to workspace 10";
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'";
"${modifier}+Shift+c" = "reload";
"${modifier}+r" = "mode 'resize'";
};
startup = [
{ command = "--no-startup-id swayidle -w timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\"'"; }
]
startup = []
++ optionals gui.sway.desktop [
{ command = "vorta"; }
{ command = "MOZ_ENABLE_WAYLAND=1 firefox"; }
@@ -154,7 +164,7 @@ in
input."type:keyboard" = {
xkb_layout = "us,de";
xkb_options = "caps:escape,grp:shifts_toggle";
xkb_options = "grp:shifts_toggle";
};
output = gui.monitors;
@@ -184,14 +194,14 @@ in
};
bars = [
{ command = "\${pkgs.waybar}/bin/waybar"; }
{ command = "${pkgs.waybar}/bin/waybar"; }
];
};
extraConfig = ''
bindsym ${modifier}+space exec kickoff-dot-desktop | kickoff --from-stdin --stdout | xargs -d '\n' swaymsg exec
set $bg-color #58536d
set $inactive-bg-color #2f343f
@@ -207,6 +217,7 @@ in
client.urgent $urgent-bg-color $urgent-bg-color $text-color #4B5177
smart_gaps inverse_outer
'';
};
};

View File

@@ -28,6 +28,12 @@ in
type = types.enum [ "fish" ];
default = "fish";
};
caps = mkOption {
description = "What key to bind caps lock to";
type = types.enum [ "ctrl-esc" "esc" "caps" ];
default = "ctrl-esc";
};
};
@@ -42,6 +48,7 @@ in
eza
ripgrep
fzf
yazi
ncdu
btop
]
@@ -52,6 +59,19 @@ in
defaultEditor = true;
};
services.keyd = mkIf (cfg.caps != "caps") {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings = {
main = mkMerge [
(mkIf (cfg.caps == "ctrl-esc") { capslock = "overload(control, esc)"; })
(mkIf (cfg.caps == "esc") { capslock = "esc"; })
];
};
};
};
programs.fish.enable = mkIf (cfg.shell == "fish") true;
};

View File

@@ -49,7 +49,7 @@ in
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; with localPackages.x86_64-linux; []
++ optional cfg.protonup.enable protonup-qt
++ optional cfg.gamescope.enable gamescope-old
++ optional cfg.gamescope.enable gamescope
++ optional cfg.discord.enable vesktop
++ optionals cfg.lutris.enable [ lutris wine ];

View File

@@ -21,8 +21,7 @@ in
allowedTCPPorts = mkOption {
description = "Which tcp ports to allow through firewall";
type = types.listOf types.int;
default = []
++ optional openssh.enable openssh.port;
default = [];
};
allowedUDPPorts = mkOption {
@@ -66,7 +65,9 @@ in
networking.nameservers = cfg.nameservers;
networking.firewall = {
enable = cfg.firewall.enable;
allowedTCPPorts = cfg.firewall.allowedTCPPorts;
allowedTCPPorts = cfg.firewall.allowedTCPPorts
++ optional openssh.enable openssh.port;
allowedUDPPorts = cfg.firewall.allowedUDPPorts;
};
};

3
overlays/default.nix Normal file
View File

@@ -0,0 +1,3 @@
{
gamescope = import ./gamescope-last-working.nix;
}

View File

@@ -0,0 +1,11 @@
final: prev: {
gamescope = prev.gamescope.overrideAttrs ( old: {
src = prev.fetchFromGitHub {
owner = "ValveSoftware";
repo = "gamescope";
rev = "d0d23c4c3010c81add1bd90cbe478ce4a386e28d";
fetchSubmodules = true;
hash = "sha256-Ym1kl9naAm1MGlxCk32ssvfiOlstHiZPy7Ga8EZegus=";
};
});
}