commit ebe17adca72ed8c5df017d8742da3e475ab3b041 Author: Aleksandr Lebedev Date: Thu Nov 7 12:35:29 2024 +0100 Initial nixos config diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b033111 --- /dev/null +++ b/flake.lock @@ -0,0 +1,730 @@ +{ + "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1729527199, + "narHash": "sha256-D5/YksfRga8Akd04ZtIkuYSIOjXVrAzQIQBSeplokzU=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "8d732fa8aff8b12ef2b1e2f00fc8153e41312b72", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1725860795, + "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "stylix", + "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" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "46.1", + "repo": "gnome-shell", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729894599, + "narHash": "sha256-nL9nzNE5/re/P+zOv7NX6bRm5e+DeS1HIufQUJ01w20=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "93435d27d250fa986bfec6b2ff263161ff8288cb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728669738, + "narHash": "sha256-EDNAU9AYcx8OupUzbTbWE1d3HYdeG0wO6Msg3iL1muk=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "0264e698149fcb857a66a53018157b41f8d97bb0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1729905757, + "narHash": "sha256-4KlQKI/SqiF25pMr7tLZbqHXFdEeoT1KZF+b/6Af7yw=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "0b29caf9ab86518ff474eed5e7d19c12f96ebbd0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728345020, + "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "a7c183800e74f337753de186522b9017a07a8cee", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728168612, + "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728941256, + "narHash": "sha256-WRypmcZ2Bw94lLmcmxYokVOHPJSZ7T06V49QZ4tkZeQ=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "fd4be8b9ca932f7384e454bcd923c5451ef2aa85", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1726874836, + "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "nix-flatpak": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "utils": "utils" + }, + "locked": { + "lastModified": 1728804768, + "narHash": "sha256-WG8KWmT72SA1XrmixxJwI1RRWrT9D97kkYSE5OfOJdg=", + "owner": "GermanBread", + "repo": "declarative-flatpak", + "rev": "42cc2c4d97a03889d551cc82c43a0b124fd403f6", + "type": "github" + }, + "original": { + "owner": "GermanBread", + "ref": "stable-v3", + "repo": "declarative-flatpak", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1729413321, + "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1730137625, + "narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64b80bfb316b57cdb8919a9110ef63393d74382a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1729665710, + "narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "hyprland": "hyprland", + "nix-flatpak": "nix-flatpak", + "nixpkgs": "nixpkgs_3", + "stylix": "stylix" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_4", + "systems": "systems_3", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux" + }, + "locked": { + "lastModified": 1729963473, + "narHash": "sha256-uGjTjvvlGQfQ0yypVP+at0NizI2nrb6kz4wGAqzRGbY=", + "owner": "danth", + "repo": "stylix", + "rev": "04afcfc0684d9bbb24bb1dc77afda7c1843ec93b", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1728166987, + "narHash": "sha256-w6dVTguAn9zJ+7aPOhBQgDz8bn6YZ7b56cY8Kg5HJRI=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "fb9c8d665af0588bb087f97d0f673ddf0d501787", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2a40ea5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,48 @@ +{ + description = "NixOS config"; + + inputs = { + nixpkgs = { + url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + + }; + hyprland.url = "github:hyprwm/Hyprland"; + stylix.url = "github:danth/stylix"; + nix-flatpak.url = "github:GermanBread/declarative-flatpak/stable-v3"; + + #nur.url = "github:nix-community/NUR"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, stylix, nix-flatpak, ... }@inputs: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + + }; + }; + in + { + nixosConfigurations = { + homepc = nixpkgs.lib.nixosSystem { + specialArgs = { inherit system; inherit inputs; }; + + modules = [ + #nur.nixosModules.nur + ./nixos/configuration.nix + inputs.home-manager.nixosModules.default + stylix.nixosModules.stylix + nix-flatpak.nixosModules.default + ]; + }; + }; + }; +} diff --git a/gc-collect.sh b/gc-collect.sh new file mode 100644 index 0000000..fa3a5c8 --- /dev/null +++ b/gc-collect.sh @@ -0,0 +1,2 @@ +sudo nix-collect-garbage -d && nix-collect-garbage -d && sudo nixos-rebuild switch --flake ./#homepc --show-trace + diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..c886375 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,308 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, stylix, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.home-manager.nixosModules.default + ./firefox.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + networking.hostName = "nixosbtw"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "ru_RU.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us,ru"; + variant = ""; + options = "grp:caps_toggle"; + }; + console.keyMap = "us"; + + services.udisks2.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.kylekrein = { + isNormalUser = true; + description = "Aleksandr Lebedev"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + qt = { + enable = true; + platformTheme = "qt5ct"; + style = "kvantum"; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + kitty + kdePackages.qtwayland + libsForQt5.qt5.qtwayland + libsForQt5.qt5.qtsvg + kdePackages.qtsvg + kio-fuse #to mount remote filesystems via FUSE + libsForQt5.kio-extras #extra protocols support (sftp, fish and more) + kdePackages.kio-fuse #to mount remote filesystems via FUSE + kdePackages.kio-extras #extra protocols support (sftp, fish and more) + fastfetch + firefox + telegram-desktop + waybar + swaynotificationcenter + libnotify + swww + vlc + wofi + wl-clipboard + git + hyprpicker + networkmanagerapplet + egl-wayland + kitty-themes + btop + hyprlock + hypridle + solaar + pavucontrol + brightnessctl + satty + grim + slurp + clipse + libheif #https://github.com/NixOS/nixpkgs/issues/164021 + libheif.out + + #kde + libsForQt5.systemsettings + libsForQt5.kate + libsForQt5.gwenview + libsForQt5.breeze-icons + libsForQt5.breeze-qt5 + libsForQt5.ark + libsForQt5.qtstyleplugin-kvantum + libsForQt5.okular + libsForQt5.kcalc + polkit-kde-agent + libsForQt5.kdeconnect-kde + kdePackages.kdesdk-thumbnailers + libsForQt5.kdegraphics-thumbnailers + kdePackages.kdegraphics-thumbnailers + catppuccin-kvantum + + #kde support tools + libsForQt5.qt5ct + kdePackages.qt6ct + libsForQt5.kimageformats + libsForQt5.dolphin + libsForQt5.dolphin-plugins + ]; + #xdg.portal = { + # enable = true; + # config = { + # hyprland = { + # default = [ + # "hyprland" + # "kde" + # ]; + # }; + # }; + # configPackages = with pkgs; [ + # xdg-desktop-portal-hyprland + # kdePackages.xdg-desktop-portal-kde + # ]; + #}; + environment.pathsToLink = [ + "share/thumbnailers" + ]; + fonts.packages = with pkgs; [ + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + font-awesome + hack-font + ]; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + hardware = { + graphics = { + enable = true; + extraPackages = with pkgs; [ + nvidia-vaapi-driver + ]; + }; + nvidia = { + # https://nixos.wiki/wiki/Nvidia + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = true;#false; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + # Currently alpha-quality/buggy, so false is currently the recommended setting. + open = true; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + logitech.wireless.enable = true; + }; + services.xserver.videoDrivers = [ "nvidia" ]; + + security.polkit.enable = true; + + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers + }; + + #programs.thunar = { +# enable = true; +# plugins = with pkgs.xfce; [ +# thunar-archive-plugin +# thunar-volman +# ]; + # }; + #programs.xfconf.enable = true; # so thunar can save config + #services.gvfs.enable = true; # Mount, trash, and other functionalities + #services.tumbler.enable = true; # Thumbnail support for images + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + + home-manager = { + extraSpecialArgs = {inherit pkgs; inherit inputs;}; + users = { + "kylekrein" = import ./home.nix; + }; + }; + stylix = { + enable = true; + image = ./hyprland/wallpaper.jpg; + autoEnable = true; + targets = { + gtk.enable = true; + }; + fonts = { + sizes = { + applications = 14; + desktop = 12; + popups = 12; + terminal = 16; + }; + }; + polarity = "dark"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + }; + + #services.flatpak.enable = true; + #services.flatpak.packages = [ +# "flathub:app/org.kde.dolphin//stable" + # ]; + + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? + + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages."${pkgs.system}".hyprland; + xwayland.enable = true; + }; + #services.hypridle.enable = true; + + services.xserver.enable = true; + services.displayManager.sddm.enable = true; + # services.displayManager.sddm.wayland.enable = true; + nix = { + settings.experimental-features = ["nix-command" "flakes"]; + }; +} diff --git a/nixos/firefox.nix b/nixos/firefox.nix new file mode 100644 index 0000000..165b7e9 --- /dev/null +++ b/nixos/firefox.nix @@ -0,0 +1,113 @@ +{ config, pkgs, ... }: + + let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; + in +{ + programs = { + firefox = { + enable = true; + languagePacks = [ "de" "en-US" "ru"]; + + /* ---- POLICIES ---- */ + # Check about:policies#documentation for options. + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value= true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "never"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" + + /* ---- EXTENSIONS ---- */ + # Check about:support for extension/add-on ID strings. + # Valid strings for installation_mode are "allowed", "blocked", + # "force_installed" and "normal_installed". + #https://mozilla.github.io/policy-templates/#extensionsettings + ExtensionSettings = { + "*".installation_mode = "allowed"; # blocks all addons except the ones specified below +# uBlock Origin + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + # Privacy Badger: + "jid1-MnnxcxisBPnSXQ@jetpack" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; + installation_mode = "force_installed"; + }; + + # Dark Reader + "addon@darkreader.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi"; + installation_mode = "force_installed"; + }; + #auto tab discard + "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/auto-tab-discard/latest.xpi"; + installation_mode = "force_installed"; + }; + # global speed + "{f4961478-ac79-4a18-87e9-d2fb8c0442c4}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/global-speed/latest.xpi"; + installation_mode = "force_installed"; + }; + # sponsorblock + "sponsorBlocker@ajay.app" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"; + installation_mode = "force_installed"; + }; + + # Adguard adblocker + "adguardadblocker@adguard.com" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/adguard-adblocker/latest.xpi"; + installation_mode = "force_installed"; + }; + + }; + /* ---- PREFERENCES ---- */ + # Check about:config for options. + Preferences = { + "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + "extensions.pocket.enabled" = lock-false; + "extensions.screenshots.disabled" = lock-true; + "browser.startup.page" = 3; # restore session on startup + "browser.topsites.contile.enabled" = lock-false; + "browser.formfill.enable" = lock-false; + "browser.search.suggest.enabled" = lock-false; + "browser.search.suggest.enabled.private" = lock-false; + "browser.urlbar.suggest.searches" = lock-false; + "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + "browser.newtabpage.activity-stream.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + }; + }; + }; +} diff --git a/nixos/gruvbox-plus.nix b/nixos/gruvbox-plus.nix new file mode 100644 index 0000000..0710541 --- /dev/null +++ b/nixos/gruvbox-plus.nix @@ -0,0 +1,14 @@ +{ pkgs }: + +pkgs.stdenv.mkDerivation { + name = "gruvbox-plus"; + src = pkgs.fetchurl { + url = "https://github.com/SylEleuth/gruvbox-plus-icon-pack/releases/tag/v5.5.0/gruvbox-plus-icon-pack-5.5.0.zip"; + sha256 = "hDhqR0ynVlJEmpxD5eeCqbYHF1++SgRWmvncqnZ3hE0="; + }; + dontUnpack = true; + installPhase = '' + mkdir -p $out + ${pkgs.unzip}/bin/unzip $src -d $out/ + ''; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..c007890 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/10040de2-c5df-42c9-94fa-d6d9d76397f4"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9973-FDA6"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/88d26139-5a1c-4ced-bd0f-a0f118d7e773"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/home.nix b/nixos/home.nix new file mode 100644 index 0000000..b44fa30 --- /dev/null +++ b/nixos/home.nix @@ -0,0 +1,167 @@ +{ config, pkgs, ... }: + + let + #nur = import (builtins.fetchTarball { + # Get the revision by choosing a version from https://github.com/nix-community/NUR/commits/master + #url = "https://github.com/nix-community/NUR/archive/e7fee426abaf126e6bfb6c84f710f57f0e83491c.tar.gz"; + # Get the hash by running `nix-prefetch-url --unpack ` on the above url + #sha256 = "01wx2il71dnsvviqphpdykr6h0hazf6x28ml7xrpr8fdkg1lvpjs"; +#}) pkgs {}; + + # gruvboxPlus = import ./gruvbox-plus.nix {inherit pkgs;}; + in +{ + imports = + [ + ./hyprland/hyprland.nix + ]; + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "kylekrein"; + home.homeDirectory = "/home/kylekrein"; + + qt = { + enable = true; + platformTheme.name = "qtct"; + style.name = "kvantum"; + }; + #xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { +# General.theme = "Catppuccin-Mocha"; + # }; + xdg.configFile = { + "Kvantum/kvantum.kvconfig".text = '' + [General] + theme=catppuccin-mocha + ''; + + # The important bit is here, links the theme directory from the package to a directory under `~/.config` + # where Kvantum should find it. + "Kvantum/catppuccin-mocha".source = "${pkgs.catppuccin-kvantum}/share/Kvantum/catppuccin-mocha"; + }; + + #xdg.configFile."qt5ct/qt5ct.conf".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { +# Appearance.icon_theme = "Breeze Dark"; +# }; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "24.05"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs;[ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + obs-studio + vesktop + ]; + + + programs.kitty = { + enable = true; + font = { + #name = "JetBrainsMono Nerd Font"; + #size = 16; + }; + settings = { + confirm_os_window_close = 0; + }; + #shellIntegration.enableFishIntegration = true; + themeFile = "Catppuccin-Macchiato"; + #Also available: Catppuccin-Frappe Catppuccin-Latte Catppuccin-Macchiato Catppuccin-Mocha + # See all available kitty themes at: https://github.com/kovidgoyal/kitty-themes/blob/46d9dfe230f315a6a0c62f4687f6b3da20fd05e4/themes.json + }; + programs.git = { + enable = true; + userName = "Aleksandr Lebedev"; + userEmail = "alex.lebedev2003@icloud.com"; + extraConfig = { + credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret"; + }; + }; + + + #gtk = { +# enable = true; +# cursorTheme.name = "Bibata-Modern-Ice"; +# cursorTheme.package = pkgs.bibata-cursors; +# theme.package = pkgs.adw-gtk3; +# theme.name = "adw-gtk3"; +# iconTheme.package = gruvboxPlus; +# iconTheme.name = "GruvboxPlus"; + # }; + + #programs.firefox = { + #enable = true; + #profiles."kylekrein".extensions = with nur.repos.rycee.firefox-addons; [ + # ublock-origin + #darkreader + #videospeed + #auto-tab-discard + #privacy-badger + #sponsorblock + #]; + #profiles.default = { + # id = 0; + # name = "Default"; + # isDefault = true; + #}; +#}; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/kylekrein/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + # EDITOR = "emacs"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/nixos/hyprland/hypridle.nix b/nixos/hyprland/hypridle.nix new file mode 100644 index 0000000..84852d6 --- /dev/null +++ b/nixos/hyprland/hypridle.nix @@ -0,0 +1,61 @@ +{ pkgs, lib, ... }: +let +suspendScript = pkgs.writeShellScript "suspend-script" '' + # check if any player has status "Playing" + ${lib.getExe pkgs.playerctl} -a status | ${lib.getExe pkgs.ripgrep} Playing -q + # only suspend if nothing is playing + if [ $? == 1 ]; then + loginctl lock-session + ${pkgs.systemd}/bin/systemctl suspend + fi + ''; +in +{ + +services.hypridle = { + enable = true; + settings = { + +general = { + lock_cmd="pidof hyprlock || hyprlock"; + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display. + ignore_dbus_inhibit = false; +}; + +listener = [ + +#{ +# on-resume="brightnessctl -r"; # monitor backlight restore. +# on-timeout="brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. +# timeout=240; +#} +#{ +# on-resume="brightnessctl -rd rgb:kbd_backlight"; +# on-timeout="brightnessctl -sd rgb:kbd_backlight set 0"; +# timeout=300; +#} +{ + on-timeout="notify-send \"You're idle. Locking in 30 seconds.\""; + timeout=830; +} +#{ +# on-timeout="loginctl lock-session"; +# timeout=360; +#} +{ + on-timeout = suspendScript.outPath; + timeout = 900; +} +#{ +# on-resume="hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. +# on-timeout="hyprctl dispatch dpms off"; # screen off when timeout has passed +# timeout=420; +#} +]; + + + }; +}; + +} diff --git a/nixos/hyprland/hyprland.nix b/nixos/hyprland/hyprland.nix new file mode 100644 index 0000000..8bedf56 --- /dev/null +++ b/nixos/hyprland/hyprland.nix @@ -0,0 +1,199 @@ +{ pkgs, lib, ... }: +let +toggle_monitors = ./toggle_monitors.sh; +wallpaper-image = ./wallpaper.jpg; +in +{ + imports = [ + ./waybar.nix + ./hyprlock.nix + ./hypridle.nix + ]; + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + settings = { + monitor = [ + "DP-1,2560x1440@75,1600x0,1.6" + "DP-3,2560x1440@75,0x0,1.6" + ]; + + xwayland = { + force_zero_scaling = true; + }; + + exec-once = [ + "waybar &" + "nm-applet &" + "swaync &" + "solaar -w hide &" + "hypridle &" + "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1 &" #https://nixos.wiki/wiki/Polkit + "clipse -listen &" + "swww-daemon &" + "${pkgs.swww}/bin/swww img ${wallpaper-image} &" + ]; + exec = [ + + "${pkgs.swww}/bin/swww img ${wallpaper-image} &" + ]; + "$mod" = "SUPER"; + "$mainMod" = "$mod"; + "$terminal" = "${pkgs.kitty}/bin/kitty"; + "$fileManager" = "dolphin"; + "$browser" = "firefox"; + "$menu" = "wofi --show drun"; + "$clipboardManager" = "$terminal --class clipse -e 'clipse'"; + "$makeRegionScreenshot" = "grim -g \"$(slurp -w 0)\" - | satty --early-exit --copy-command 'wl-copy' --filename '-' --initial-tool brush"; + bind = [ + "$mod, T, exec, $terminal" + "$mod, Q, killactive," + "$mod, M, exit," + "$mod, B, exec, $browser" + "$mod SHIFT, V, togglefloating," + "$mod, C, exec, $fileManager" + "$mod, F, fullscreen," + "$mod, R, exec, $menu" + "$mod, V, exec, $clipboardManager" + "$mod SHIFT, I, exec, source ${toggle_monitors}" + "$mod SHIFT, O, exec, hyprctl dispatch dpms on" + # Move focus with mainMod + arrow keys + "$mod, H, movefocus, l" + "$mod, L, movefocus, r" + "$mod, K, movefocus, u" + "$mod, J, movefocus, d" + # Switch workspaces with mainMod + [0-9] + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mainMod SHIFT, 1, movetoworkspace, 1" + "$mainMod SHIFT, 2, movetoworkspace, 2" + "$mainMod SHIFT, 3, movetoworkspace, 3" + "$mainMod SHIFT, 4, movetoworkspace, 4" + "$mainMod SHIFT, 5, movetoworkspace, 5" + "$mainMod SHIFT, 6, movetoworkspace, 6" + "$mainMod SHIFT, 7, movetoworkspace, 7" + "$mainMod SHIFT, 8, movetoworkspace, 8" + "$mainMod SHIFT, 9, movetoworkspace, 9" + "$mainMod SHIFT, 0, movetoworkspace, 10" + + # Swap Windows + + "$mainMod SHIFT, H, swapwindow, l" + "$mainMod SHIFT, L, swapwindow, r" + "$mainMod SHIFT, K, swapwindow, u" + "$mainMod SHIFT, J, swapwindow, d" + + #Resize Windows + "$mainMod CTRL, H, resizeactive, -50 0" + "$mainMod CTRL, L, resizeactive, 50 0" + "$mainMod CTRL, K, resizeactive, 0 -50" + "$mainMod CTRL, J, resizeactive, 0 50" + + "$mainMod, P, exec, $makeRegionScreenshot" + "$mainMod ALT, L, exec, hyprlock" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + input = { + kb_layout = "us, ru"; + kb_options = "grp:caps_toggle"; + }; + env = [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "GBM_BACKEND,nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "NVD_BACKEND,direct" + "XCURSOR_SIZE,24" + "HYPRCURSOR_SIZE,24" + "__GL_GSYNC_ALLOWED,1" + "QT_QPA_PLATFORM,wayland" + #"QT_QPA_PLATFORMTHEME,kde" + #"QT_STYLE_OVERRIDE,Breeze" + #"GDK_SCALE,1.6" + #"QT_SCALE_FACTOR,1.6" + ]; + + cursor = { + no_hardware_cursors = true; + }; + + general = { + gaps_in = 5; + gaps_out = 20; + border_size = 2; + + #"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + #"col.inactive_border" = "rgba(595959aa)"; + resize_on_border = false; + allow_tearing = false; + layout = "dwindle"; + + }; + + windowrulev2 = [ + # Ignore maximize requests from apps. You'll probably like this. + "suppressevent maximize, class:.*" + + # Fix some dragging issues with XWayland + "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" + + # Fix for issues with steam + "stayfocused, title:^()$,class:^(steam)$" + "minsize 1 1, title:^()$,class:^(steam)$" + + #for clipboard manager + "float,class:(clipse)" + "size 622 652,class:(clipse)" # set the size of the window as necessary + ]; + + decoration = { + rounding = 10; + + active_opacity = 0.9; + inactive_opacity = 0.7; + + drop_shadow = true; + shadow_range = 4; + shadow_render_power = 3; + #"col.shadow" = "rgba(1a1a1aee)"; + + blur = { + enabled = true; + size = 3; + passes = 1; + + vibrancy = 0.1696; + }; + + }; + + animations = { + enabled = true; + + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; + }; + }; +} diff --git a/nixos/hyprland/hyprlock.nix b/nixos/hyprland/hyprlock.nix new file mode 100644 index 0000000..0bb2f57 --- /dev/null +++ b/nixos/hyprland/hyprlock.nix @@ -0,0 +1,58 @@ +{ pkgs, lib, ... }: +{ + programs.hyprlock = { + enable = true; + settings = { +background = { + monitor = { + #path = /home/me/someImage.png # supports png, jpg, webp (no animations, though) + color = "rgba(25, 20, 20, 1.0)"; + + # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations + blur_passes = 0; # 0 disables blurring + blur_size = 7; + noise = 0.0117; + contrast = 0.8916; + brightness = 0.8172; + vibrancy = 0.1696; + vibrancy_darkness = 0.0; + }; +}; +input-field = { + monitor = { + size = "200, 50"; + outline_thickness = 3; + dots_size = 0.33; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.15; # Scale of dots' absolute size, -1.0 - 1.0 + dots_center = false; + dots_rounding = -1; # -1 default circle, -2 follow input-field rounding + dots_fade_time = 200; # Milliseconds until a dot fully fades in + dots_text_format = "";# Text character used for the input indicator. Leave empty for a rectangle that will be rounded via dots_rounding (default). + outer_color = "rgb(151515)"; + inner_color = "rgb(200, 200, 200)"; + font_color = "rgb(10, 10, 10)"; + font_family = "Noto Sans"; # Font used for placeholder_text, fail_text and dots_text_format. + fade_on_empty = false; + fade_timeout = 1000; # Milliseconds before fade_on_empty is triggered. + placeholder_text = "Input Password..."; # Text rendered in the input box when it's empty. + hide_input = false; + rounding = -1; # -1 means complete rounding (circle/oval) + check_color = "rgb(204, 136, 34)"; + fail_color = "rgb(204, 34, 34)"; # if authentication failed, changes outer_color and fail message color + fail_text = "$FAIL ($ATTEMPTS)"; # can be set to empty + fail_timeout = 2000; # milliseconds before fail_text and fail_color disappears + fail_transition = 300; # transition time in ms between normal outer_color and fail_color + capslock_color = -1; + numlock_color = -1; + bothlock_color = -1; # when both locks are active. -1 means don't change outer color (same for above) + invert_numlock = false; # change color if numlock is off + swap_font_color = false; # see below + + position = "0, -20"; + halign = "center"; + valign = "center"; + }; +}; +}; + }; +} diff --git a/nixos/hyprland/power_menu.xml b/nixos/hyprland/power_menu.xml new file mode 100644 index 0000000..f7e9109 --- /dev/null +++ b/nixos/hyprland/power_menu.xml @@ -0,0 +1,28 @@ + + + + + + ⏾ Sleep + + + + + 󱦟 Hibernate + + + + + 󰐥 Shutdown + + + + + + + +  Reboot + + + + diff --git a/nixos/hyprland/toggle_monitors.sh b/nixos/hyprland/toggle_monitors.sh new file mode 100644 index 0000000..f419e25 --- /dev/null +++ b/nixos/hyprland/toggle_monitors.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Получаем информацию о подключенных мониторах +monitors_on=$(hyprctl monitors | grep "dpmsStatus: 1" | wc -l) +echo $monitors_on +if [ $monitors_on -gt 0 ]; then + # Если мониторы включены, выключаем их + hyprctl dispatch dpms off +else + hyprctl dispatch dpms on +fi + diff --git a/nixos/hyprland/wallpaper.jpg b/nixos/hyprland/wallpaper.jpg new file mode 100644 index 0000000..1475467 Binary files /dev/null and b/nixos/hyprland/wallpaper.jpg differ diff --git a/nixos/hyprland/waybar.nix b/nixos/hyprland/waybar.nix new file mode 100644 index 0000000..5a2c8a9 --- /dev/null +++ b/nixos/hyprland/waybar.nix @@ -0,0 +1,167 @@ +{ pkgs, lib, ... }: + +{ + programs.waybar = { + enable = true; + #systemd.enable = true; + + #window#waybar { + # background: transparent; + #border-bottom: none; + #} + #${builtins.readFile "${pkgs.waybar}/etc/xdg/waybar/style.css"} + style = '' + ${builtins.readFile ./waybarstyle.css} + + + * { + font-size: 15px; + } + ''; + settings = [{ + height = 20; + layer = "top"; + position = "top"; + tray = { spacing = 3; }; + modules-center = [ + #"hyprland/window" + "clock" + ]; + modules-left = [ "hyprland/workspaces" ]; + modules-right = [ + "pulseaudio" + "network" + #"cpu" + #"memory" + #"temperature" + "hyprland/language" + ] #++ (if config.hostId == "yoga" then [ "battery" ] else [ ]) + ++ [ + "tray" + "custom/notification" + #"custom/disablehypridle" + "custom/power" + ]; + battery = { + format = "{capacity}% {icon}"; + format-alt = "{time} {icon}"; + format-charging = "{capacity}% "; + format-icons = [ "" "" "" "" "" ]; + format-plugged = "{capacity}% "; + states = { + critical = 15; + warning = 30; + }; + }; + clock = { + format-alt = "{:%Y-%m-%d}"; + tooltip-format = "{:%Y-%m-%d | %H:%M}"; + }; + cpu = { + format = "{usage}% "; + tooltip = false; + }; + "hyprland/language" = { + format = " {}"; + }; + memory = { format = "{}% "; }; + network = { + interval = 1; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + format-disconnected = "Disconnected ⚠"; + format-ethernet = "{ifname}: {ipaddr}/{cidr}  up: {bandwidthUpBits} down: {bandwidthDownBits}"; + format-linked = "{ifname} (No IP) "; + #format-wifi = "{signalStrength}% "; + format-wifi = "{signalStrength}%  "; + tooltip-format = "{essid} ({signalStrength}%) "; + }; + pulseaudio = { + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-icons = { + car = ""; + default = [ "" "" "" ]; + handsfree = ""; + headphones = ""; + headset = ""; + phone = ""; + portable = ""; + }; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = ""; + on-click = "pavucontrol"; + }; + "hyprland/submap" = { format = ''{}''; }; + temperature = { + critical-threshold = 80; + format = "{temperatureC}°C {icon}"; + format-icons = [ "" "" "" ]; + }; + + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = true; + warp-on-scroll = true; + format = "{name}{icon}"; + format-icons = { + urgent = ""; + active = ""; + default = ""; + }; + #persistent-workspaces = { + # "*" = 3; + #}; + }; + + "custom/power" = { + format = "⏻ "; + tooltip = false; + menu = "on-click"; + menu-file = ./power_menu.xml; + menu-actions = { + shutdown = "shutdown -h now"; + reboot = "reboot"; + suspend = "systemctl suspend"; + hibernate = "systemctl hibernate"; + }; + }; + + "custom/notification" = { + tooltip = false; + format = "{icon}"; + format-icons = { + notification = " "; + none = " "; + dnd-notification = " "; + dnd-none = "  "; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "sleep 0.1 && swaync-client -t -sw"; + on-click-right = "sleep 0.1 && swaync-client -d -sw"; + escape = true; + }; + + "custom/disablehypridle" = { + exec = '' + if pgrep -x "hypridle" > /dev/null; then + echo "{\"text\": \"  \", \"tooltip\": \"Hypridle is running\", \"class\": \"active\"}"; + else + echo "{\"text\": \"  \", \"tooltip\": \"Hypridle is not running\", \"class\": \"inactive\"}"; + fi + ''; + return-type = "json"; + on-click = '' + if pgrep -x "hypridle" > /dev/null; then + pkill hypridle + else + hypridle & + fi + ''; + }; + }]; + }; +} diff --git a/nixos/hyprland/waybarstyle.css b/nixos/hyprland/waybarstyle.css new file mode 100644 index 0000000..460f6bf --- /dev/null +++ b/nixos/hyprland/waybarstyle.css @@ -0,0 +1,92 @@ +* { + border: none; + font-family: Font Awesome, Roboto, Arial, sans-serif; + font-size: 13px; + color: #B9826A;/*#ffffff;*/ + border-radius: 20px; +} + +window { + /*font-weight: bold;*/ +} +window#waybar { + background: rgba(0, 0, 0, 0); +} +/*-----module groups----*/ +.modules-right { + background-color: rgba(0,43,51,0.85); + margin: 2px 10px 0 0; +} +.modules-center { + background-color: rgba(0,43,51,0.85); + margin: 2px 0 0 0; +} +.modules-left { + margin: 2px 0 0 5px; + background-color: rgba(0,119,179,0.6); +} +/*-----modules indv----*/ +#workspaces button { + padding: 1px 5px; + background-color: transparent; +} +#workspaces button:hover { + box-shadow: inherit; + background-color: rgba(0,153,153,1); +} + +#workspaces button.focused { + background-color: rgba(0,43,51,0.85); +} + +#clock, +#battery, +#cpu, +#memory, +#temperature, +#network, +#pulseaudio, +#custom-media, +#tray, +#mode, +#custom-power, +#custom-menu, +#idle_inhibitor { + padding: 0 10px; +} +#mode { + color: #cc3436; + font-weight: bold; +} +#custom-power { + background-color: rgba(0,119,179,0.6); + border-radius: 100px; + margin: 5px 5px; + padding: 1px 1px 1px 6px; +} +/*-----Indicators----*/ +#idle_inhibitor.activated { + color: #2dcc36; +} +#pulseaudio.muted { + color: #cc3436; +} +#battery.charging { + color: #2dcc36; +} +#battery.warning:not(.charging) { + color: #e6e600; +} +#battery.critical:not(.charging) { + color: #cc3436; +} +#temperature.critical { + color: #cc3436; +} +/*-----Colors----*/ +/* + *rgba(0,85,102,1),#005566 --> Indigo(dye) + *rgba(0,43,51,1),#002B33 --> Dark Green + *rgba(0,153,153,1),#009999 --> Persian Green + * + */ diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..384d29d --- /dev/null +++ b/update.sh @@ -0,0 +1,4 @@ +#bin/bash + +sudo nix flake update --flake . +sudo nixos-rebuild boot --flake ./#homepc --show-trace