hyprland monitors

This commit is contained in:
Sam 2024-05-30 21:20:39 +01:00
parent eca3a72a8f
commit 95bb8156a6
10 changed files with 187 additions and 79 deletions

View File

@ -29,11 +29,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716773194, "lastModified": 1717032306,
"narHash": "sha256-rskkGmWlvYFb+CXedBiL8eWEuED0Es0XR4CkJ11RQKY=", "narHash": "sha256-s3Sis+M1qTSVIehHrEKBzHBpqprIFJli5V6WojkJnYE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "10986091e47fb1180620b78438512b294b7e8f67", "rev": "8ea5bcccc03111bdedaeaae9380dfab61e9deb33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -182,11 +182,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716908526, "lastModified": 1717052710,
"narHash": "sha256-Zl6e/sEVDh07K47XxDGPsXTYT4nI6llUDbQ4xMIwp7k=", "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "373ead20606efa9181cd15ba19a5deac7ead1492", "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -203,11 +203,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716457508, "lastModified": 1717052710,
"narHash": "sha256-ZxzffLuWRyuMrkVVq7wastNUqeO0HJL9xqfY1QsYaqo=", "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "850cb322046ef1a268449cf1ceda5fd24d930b05", "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -239,11 +239,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1716511055, "lastModified": 1716993688,
"narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=", "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "0bea8222f6e83247dd13b055d83e64bce02ee532", "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -255,11 +255,11 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1716917146, "lastModified": 1717081517,
"narHash": "sha256-YopICr9b8EqsysVABoJAIDBPtk5PiJjqz+eRWjYHLP0=", "narHash": "sha256-Pvennf20SmdaJ7mZK4I3jjQX8jQy9Hd/KeE64e2uqHU=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "1669319dcc94896a4591dc1118f90818f2591433", "rev": "c9a84172f898001d8e1732e7b6872be9d9352cef",
"revCount": 73, "revCount": 80,
"type": "git", "type": "git",
"url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git"
}, },
@ -270,11 +270,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1716715802, "lastModified": 1716977081,
"narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", "narHash": "sha256-pFe5jLeIPlKEln5n2h998d7cpzXFdbrBMRe3suz4K1o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", "rev": "ac82a513e55582291805d6f09d35b6d8b60637a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -300,11 +300,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1716509168, "lastModified": 1716948383,
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bfb7a882678e518398ce9a31a881538679f6f092", "rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -329,11 +329,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1716833970, "lastModified": 1717081007,
"narHash": "sha256-K3tVrTna4EN86GW9IeOQJkbj57zT2xNGJg1hh26xy5c=", "narHash": "sha256-GNr1i6itjFKGXSco3lcdKe8GxEwrmSYFDUpZyXsXWp4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "a2afa5634495ee739e682e5ccb743c5c6dd90ec1", "rev": "da9bd1f2e8fc8cd8553a76a9e22afd386c18f205",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -99,6 +99,15 @@
} }
]; ];
}; };
semita = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [
./hosts/semita
home-manager.nixosModules.home-manager{
home-manager.extraSpecialArgs = specialArgs;
}
];
};
}; };
# # Standalone home-manager configuration entrypoint # # Standalone home-manager configuration entrypoint

View File

@ -20,66 +20,66 @@
]; ];
}; };
extraConfig = let extraConfig = let
monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString(m.width) }x${ toString(m.height) }@60,auto,1") config.monitors)}"; monitor = "${toString (builtins.map (m: "monitor=${ m.name },${ toString( m.width ) }x${ toString( m.height ) }@${ toString( m.refreshRate ) },${ toString( m.x ) }x${ toString( m.y ) },${ toString( m.scale ) }\n") config.monitors)}";
in '' in ''
${monitor} ${monitor}
$terminal = kitty $terminal = kitty
$fileManager = dolphin $fileManager = dolphin
$menu = wofi --show drun $menu = wofi --show drun
env = XCURSOR_SIZE,24 env = XCURSOR_SIZE,24
input { input {
kb_layout = gb kb_layout = gb
kb_variant = kb_variant =
kb_model = kb_model =
kb_options = caps:swapescape kb_options = caps:swapescape
kb_rules = kb_rules =
follow_mouse = 1 follow_mouse = 1
touchpad { touchpad {
natural_scroll = no natural_scroll = no
} }
} }
general { general {
gaps_in = 5 gaps_in = 5
gaps_out = 20 gaps_out = 20
border_size = 2 border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa) col.inactive_border = rgba(595959aa)
layout = dwindle layout = dwindle
allow_tearing = false allow_tearing = false
} }
decoration { decoration {
rounding = 10 rounding = 10
blur { blur {
enabled = true enabled = true
size = 3 size = 3
passes = 1 passes = 1
} }
drop_shadow = yes drop_shadow = yes
shadow_range = 4 shadow_range = 4
shadow_render_power = 3 shadow_render_power = 3
col.shadow = rgba(1a1a1aee) col.shadow = rgba(1a1a1aee)
} }
animations { animations {
enabled = yes enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80% animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default animation = border, 1, 10, default
@ -87,30 +87,30 @@
animation = fade, 1, 7, default animation = fade, 1, 7, default
animation = workspaces, 1, 6, default animation = workspaces, 1, 6, default
} }
dwindle { dwindle {
} }
master { master {
new_is_master = true new_is_master = true
} }
gestures { gestures {
workspace_swipe = off workspace_swipe = off
} }
misc { misc {
} }
device { device {
name = epic-mouse-v1 name = epic-mouse-v1
sensitivity = -0.5 sensitivity = -0.5
} }
$mainMod = SUPER $mainMod = SUPER
bind = $mainMod, Q, exec, $terminal bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive, bind = $mainMod, C, killactive,
bind = $mainMod, M, exit, bind = $mainMod, M, exit,
@ -118,12 +118,12 @@
bind = $mainMod, V, togglefloating, bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu bind = $mainMod, R, exec, $menu
bind = $mainMod, S, exec, rofi -show drun -show-icons bind = $mainMod, S, exec, rofi -show drun -show-icons
bind = $mainMod, left, movefocus, l bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d bind = $mainMod, down, movefocus, d
bind = $mainMod, 1, workspace, 1 bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2 bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3 bind = $mainMod, 3, workspace, 3
@ -134,7 +134,7 @@
bind = $mainMod, 8, workspace, 8 bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9 bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10 bind = $mainMod, 0, workspace, 10
bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 3, movetoworkspace, 3
@ -145,16 +145,16 @@
bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10 bind = $mainMod SHIFT, 0, movetoworkspace, 10
bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic
bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1 bind = $mainMod, mouse_up, workspace, e-1
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
exec-once=bash ~/.config/hypr/start.sh exec-once=bash ~/.config/hypr/start.sh
''; '';
}; };

View File

@ -6,22 +6,6 @@ in
services = { services = {
syncthing = { syncthing = {
enable = true; enable = true;
# user = "${user}";
# dataDir = "/home/${user}/sync";
# configDir = "/home/${user}/.config/syncthing";
# overrideDevices = true; # overrides any devices added or deleted through the WebUI
# overrideFolders = true; # overrides any folders added or deleted through the WebUI
# settings = {
# devices = {
# "device1" = { id = "UT6263Y-V3GJXNO-6KIGAKZ-KY6UQMD-ER6BT4R-4LPKT2P-V4PCJYZ-ROJZIQQ"; };
# };
# folders = {
# "sync" = { # Name of folder in Syncthing, also the folder ID
# path = "/home/${user}/sync"; # Which folder to add to Syncthing
# devices = [ "device1" ]; # Which devices to share the folder with
# };
# };
# };
}; };
}; };
} }

39
home/semita.nix Normal file
View File

@ -0,0 +1,39 @@
{
pkgs,
config,
lib,
...
}: {
imports = [
# Import users
./users/sam
./common/core
./common/optional/sops.nix
./common/optional/firefox.nix
# Import optional
./common/optional/git.nix
./common/optional/syncthing.nix
./common/optional/desktop/hyprland
./common/optional/desktop/waybar.nix
];
monitors = [
{
name = "Virtual-1";
width = 2048;
height = 1152;
refreshRate = 60;
x = 0;
primary = true;
}
{
name = "Virtual-2";
width = 2048;
height = 1152;
refreshRate = 60;
x = 2048;
}
];
}

View File

@ -9,11 +9,9 @@
] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules? ] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules?
home.packages = [ home.packages = [
pkgs.firefox
pkgs.kitty pkgs.kitty
pkgs.zathura pkgs.zathura
pkgs.xfce.thunar pkgs.xfce.thunar
#pkgs.age
]; ];
home.file = { home.file = {
@ -51,7 +49,6 @@
home.sessionVariables = { home.sessionVariables = {
EDITOR="nvim"; EDITOR="nvim";
MUSIC="$HOME/mus/music_data/";
TERMINAL="kitty"; TERMINAL="kitty";
READER="zathura"; READER="zathura";
IMAGE_VIEWER=""; IMAGE_VIEWER="";

51
hosts/semita/default.nix Normal file
View File

@ -0,0 +1,51 @@
{ inputs, config, lib, pkgs, outputs,... }:
let
# Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
dev = "/dev/vda"; # depends on target hardware
encrypted = true; # currrently only applies to btrfs
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root";
in
{
imports =
[
# Create users for this host
../common/users/sam
# Disk configuration
inputs.disko.nixosModules.disko
(import ../common/disks { device = dev; fsType = fsType; encrypted = encrypted; })
# Impermanence
inputs.impermanence.nixosModules.impermanence
(import ../common/disks/btrfs-impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
# Import core options
./hardware-configuration.nix
../common/core
# Import optional options
../common/optional/persistence.nix
../common/optional/pipewire.nix
../common/optional/hyprland.nix
../common/optional/displayManager/sddm.nix
../common/optional/openssh.nix
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
timeout = 3;
};
};
networking = {
hostName = "semita";
networkmanager.enable = true;
enableIPv6 = false;
};
services.libinput.enable = true;
}

View File

@ -0,0 +1,24 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View File

@ -38,6 +38,10 @@ in {
type = types.int; type = types.int;
default = 0; default = 0;
}; };
scale = mkOption {
type = types.int;
default = 1;
};
enabled = mkOption { enabled = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;

View File

@ -70,7 +70,7 @@ just update-sops-secrets && just update-flake-secrets && just update-flake
cp -prv . "$temp/persist/etc/nixos" cp -prv . "$temp/persist/etc/nixos"
# Install Nixos to target # Install Nixos to target
SHELL=/bin/sh nix run github:nix-community/nixos-anywhere/242444d228636b1f0e89d3681f04a75254c29f66 -- --extra-files "$temp" --disk-encryption-keys /tmp/luks_secret.key /tmp/luks_secret.key --flake .#"$config" root@"$ip" -i "$HOME/.ssh/id_ed25519" SHELL=/bin/sh nix run github:nix-community/nixos-anywhere -- --extra-files "$temp" --disk-encryption-keys /tmp/luks_secret.key /tmp/luks_secret.key --flake .#"$config" root@"$ip" -i "$HOME/.ssh/id_ed25519"
[ $? != 0 ] && echo "Error installing Nixos" && exit 1 [ $? != 0 ] && echo "Error installing Nixos" && exit 1
## Delete keys from local known_hosts ## Delete keys from local known_hosts