Add stylix, switch to nixpkg hyprland

Add stylix flake and initial config for wallpaper and catppuccin
macchiato scheme. Disabled auto theme to pick each manually

Remove hyprland flake intup to use version in nixpkgs/home-manager for
compat with stylix

Update style of swaylock using stylix
This commit is contained in:
Evie Litherland-Smith 2023-09-26 19:03:50 +01:00
parent 97b255d36d
commit 3afe79c851
5 changed files with 121 additions and 116 deletions

View file

@ -21,6 +21,24 @@
"type": "github" "type": "github"
} }
}, },
"base16": {
"inputs": {
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1689633990,
"narHash": "sha256-iwvQg2Vx0IIDWZaKo8Xmzxlv1YPHg+Kp/QSv8dRv0RY=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "dddf2e1c04845d43c89a8e9e37d574519649a404",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"catppuccin-alacritty": { "catppuccin-alacritty": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -37,6 +55,22 @@
"type": "github" "type": "github"
} }
}, },
"catppuccin-base16": {
"flake": false,
"locked": {
"lastModified": 1665586920,
"narHash": "sha256-fZDsmJ+xFjOJDoI+bPki9W7PEI5lT5aGoCYtkatcZ8A=",
"owner": "catppuccin",
"repo": "base16",
"rev": "ca74b4070d6ead4213e92da1273fcc1853de7af8",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "base16",
"type": "github"
}
},
"catppuccin-bat": { "catppuccin-bat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -197,6 +231,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"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-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -218,6 +268,22 @@
"type": "github" "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"
}
},
"gitui": { "gitui": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -254,52 +320,24 @@
"type": "github" "type": "github"
} }
}, },
"hyprland": { "home-manager_2": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1694441683,
"narHash": "sha256-aP+N3ubkvgZ4htsVKJsv8u9co4CAlstzb3CJvBj3cLE=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "df51c45d7f9e4e280b959f790f7cde6c88b9b451",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"hyprland", "stylix",
"nixpkgs" "nixpkgs"
],
"systems": [
"hyprland",
"systems"
] ]
}, },
"locked": { "locked": {
"lastModified": 1691753796, "lastModified": 1691882297,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", "narHash": "sha256-e1/LAQSGLnBywfA1TfMl0Vj3tvYka73XOZ/D2/CJowE=",
"owner": "hyprwm", "owner": "nix-community",
"repo": "hyprland-protocols", "repo": "home-manager",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", "rev": "c3ab5ea047e6dc73df530948f7367455749d8906",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "hyprwm", "owner": "nix-community",
"repo": "hyprland-protocols", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
@ -323,6 +361,7 @@
"inputs": { "inputs": {
"anyrun": "anyrun", "anyrun": "anyrun",
"catppuccin-alacritty": "catppuccin-alacritty", "catppuccin-alacritty": "catppuccin-alacritty",
"catppuccin-base16": "catppuccin-base16",
"catppuccin-bat": "catppuccin-bat", "catppuccin-bat": "catppuccin-bat",
"catppuccin-fish": "catppuccin-fish", "catppuccin-fish": "catppuccin-fish",
"catppuccin-gitui": "catppuccin-gitui", "catppuccin-gitui": "catppuccin-gitui",
@ -335,70 +374,30 @@
"doom-emacs": "doom-emacs", "doom-emacs": "doom-emacs",
"gitui": "gitui", "gitui": "gitui",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs" "stylix": "stylix"
} }
}, },
"systems": { "stylix": {
"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"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1694302348,
"narHash": "sha256-S9NOc88L/1jpNKJqBu2Hihvn0V1HHCK2hXE4bNBAStg=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "65bbbbbf0c3d6844cee3c4e294d0ba07e1f82211",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "65bbbbbf0c3d6844cee3c4e294d0ba07e1f82211",
"type": "gitlab"
}
},
"xdph": {
"inputs": { "inputs": {
"hyprland-protocols": [ "base16": "base16",
"hyprland", "flake-compat": "flake-compat",
"hyprland-protocols" "home-manager": "home-manager_2",
],
"nixpkgs": [ "nixpkgs": [
"hyprland",
"nixpkgs" "nixpkgs"
],
"systems": [
"hyprland",
"systems"
] ]
}, },
"locked": { "locked": {
"lastModified": 1694025408, "lastModified": 1694375893,
"narHash": "sha256-oJNhGfZH8Z2w3ztXdzsYVg32//cWEcPVDM3+tp/ZVfU=", "narHash": "sha256-oJGESNjJ/6o6tfuUavBZ7go4Oun7g9YKv7OqaQaY/80=",
"owner": "hyprwm", "owner": "danth",
"repo": "xdg-desktop-portal-hyprland", "repo": "stylix",
"rev": "022469529c8bc95acf222dc5a62389b04c8b1205", "rev": "c3c9f4784b4f08f6676340126858d936edbce1fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "hyprwm", "owner": "danth",
"repo": "xdg-desktop-portal-hyprland", "repo": "stylix",
"type": "github" "type": "github"
} }
} }

View file

@ -7,8 +7,8 @@
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland = { stylix = {
url = "github:hyprwm/Hyprland"; url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
anyrun = { anyrun = {
@ -25,6 +25,10 @@
url = "github:extrawurst/gitui"; url = "github:extrawurst/gitui";
flake = false; flake = false;
}; };
catppuccin-base16 = {
url = "github:catppuccin/base16";
flake = false;
};
catppuccin-alacritty = { catppuccin-alacritty = {
url = "github:catppuccin/alacritty"; url = "github:catppuccin/alacritty";
flake = false; flake = false;
@ -67,10 +71,9 @@
}; };
}; };
outputs = { self, nixpkgs, home-manager, ... }@inputs: outputs = { self, nixpkgs, home-manager, stylix, anyrun, ... }@inputs:
let let
flakeURL = "git+https://git.xenia.me.uk/xenia/nixos.git?ref=main"; flakeURL = "git+https://git.xenia.me.uk/xenia/nixos.git?ref=main";
wallpapers = { default = ./wallpapers/waves/cat-waves.png; };
catppuccin-themes = with inputs; { catppuccin-themes = with inputs; {
alacritty = "${catppuccin-alacritty}/catppuccin-macchiato.yml"; alacritty = "${catppuccin-alacritty}/catppuccin-macchiato.yml";
bat = "${catppuccin-bat}/Catppuccin-macchiato.tmTheme"; bat = "${catppuccin-bat}/Catppuccin-macchiato.tmTheme";
@ -104,15 +107,18 @@
, homeModules ? default.homeModules, stateVersion ? default.stateVersion , homeModules ? default.homeModules, stateVersion ? default.stateVersion
}: }:
let let
specialArgs = { specialArgs = { inherit hostName user group anyrun; };
inherit hostName user group;
inherit (inputs) hyprland;
};
extraSpecialArgs = specialArgs // { extraSpecialArgs = specialArgs // {
inherit wallpapers catppuccin-themes; inherit catppuccin-themes;
inherit (inputs) doom-emacs gitui anyrun; inherit (inputs) doom-emacs gitui;
}; };
commonModule = { lib, pkgs, ... }: { commonModule = { lib, pkgs, ... }: {
stylix = {
autoEnable = false;
image = ./wallpapers/waves/cat-waves.png;
base16Scheme =
"${inputs.catppuccin-base16}/base16/macchiato.yaml";
};
nix = { nix = {
settings = { settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
@ -226,6 +232,7 @@
./hosts/${hostName}/configuration.nix ./hosts/${hostName}/configuration.nix
./hosts/${hostName}/hardware-configuration.nix ./hosts/${hostName}/hardware-configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
commonModule commonModule
] ++ systemModules ++ serviceModules; ] ++ systemModules ++ serviceModules;
}; };

View file

@ -1,8 +1,7 @@
{ config, lib, pkgs, hyprland, wallpapers, catppuccin-themes, ... }: { config, lib, pkgs, catppuccin-themes, ... }:
{ {
imports = [ imports = [
hyprland.homeManagerModules.default
./wlogout/default.nix ./wlogout/default.nix
./waybar/default.nix ./waybar/default.nix
./swaync/default.nix ./swaync/default.nix
@ -35,10 +34,11 @@
enable = true; enable = true;
systemdTarget = "hyprland-session.target"; systemdTarget = "hyprland-session.target";
}; };
stylix.targets.hyprland.enable = true;
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
package = null; # Use package from nixpkgs
xwayland.enable = true; xwayland.enable = true;
systemdIntegration = true;
extraConfig = import ./config.nix { extraConfig = import ./config.nix {
inherit config pkgs; inherit config pkgs;
theme = catppuccin-themes.hyprland; theme = catppuccin-themes.hyprland;
@ -47,8 +47,8 @@
xdg = { xdg = {
configFile = { configFile = {
"hypr/hyprpaper.conf".text = '' "hypr/hyprpaper.conf".text = ''
preload = ${wallpapers.default} preload = ${config.stylix.image}
wallpaper = ,${wallpapers.default} wallpaper = ,${config.stylix.image}
''; '';
"hypr/macchiato.conf".source = ./macchiato.conf; "hypr/macchiato.conf".source = ./macchiato.conf;
"hypr/extra.conf" = lib.mkDefault { text = ""; }; "hypr/extra.conf" = lib.mkDefault { text = ""; };

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
stylix.targets.swaylock.enable = true;
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
package = pkgs.swaylock-effects; package = pkgs.swaylock-effects;
@ -10,10 +11,10 @@
indicator-thickness = 7; indicator-thickness = 7;
effect-blur = "7x5"; effect-blur = "7x5";
effect-vignette = "0.5:0.5"; effect-vignette = "0.5:0.5";
ring-color = "24273a"; # Catppuccin base # ring-color = "24273a"; # Catppuccin base
key-hl-color = "b7bdf8"; # Catppuccin lavender # key-hl-color = "b7bdf8"; # Catppuccin lavender
line-color = "24273a"; # Catppuccin base # line-color = "24273a"; # Catppuccin base
separator-color = "8bd5ca"; # Catppuccin teal # separator-color = "8bd5ca"; # Catppuccin teal
grace = 2; grace = 2;
fade-in = 0.2; fade-in = 0.2;
}; };

View file

@ -1,5 +1,7 @@
{ pkgs, user ? "xenia", hyprland, ... }: { { pkgs, user ? "xenia", ... }:
imports = [ ./desktop.nix hyprland.nixosModules.default ];
{
imports = [ ./desktop.nix ];
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
waybar = prev.waybar.overrideAttrs (oldAttrs: { waybar = prev.waybar.overrideAttrs (oldAttrs: {
@ -29,10 +31,7 @@
blueman.enable = true; blueman.enable = true;
gvfs.enable = true; gvfs.enable = true;
tumbler.enable = true; tumbler.enable = true;
xserver.displayManager = { xserver.displayManager.defaultSession = "hyprland";
sessionPackages = [ hyprland.packages.${pkgs.system}.hyprland ];
defaultSession = "hyprland";
};
}; };
fonts = { fonts = {
packages = with pkgs; [ packages = with pkgs; [
@ -70,7 +69,6 @@
programs = { programs = {
hyprland = { hyprland = {
enable = true; enable = true;
package = hyprland.packages.${pkgs.system}.hyprland;
xwayland.enable = true; xwayland.enable = true;
}; };
thunar = { thunar = {