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

View File

@ -20,7 +20,7 @@
];
};
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 ''
${monitor}

View File

@ -6,22 +6,6 @@ in
services = {
syncthing = {
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?
home.packages = [
pkgs.firefox
pkgs.kitty
pkgs.zathura
pkgs.xfce.thunar
#pkgs.age
];
home.file = {
@ -51,7 +49,6 @@
home.sessionVariables = {
EDITOR="nvim";
MUSIC="$HOME/mus/music_data/";
TERMINAL="kitty";
READER="zathura";
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;
default = 0;
};
scale = mkOption {
type = types.int;
default = 1;
};
enabled = mkOption {
type = types.bool;
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"
# 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
## Delete keys from local known_hosts