add build.conf.nix and stuff

This commit is contained in:
mehbark 2023-08-15 09:38:01 -04:00
parent a9224fe25a
commit 181f1b2713
4 changed files with 41 additions and 3 deletions

3
build.conf.nix Normal file
View file

@ -0,0 +1,3 @@
{
use-x11 = false;
}

View file

@ -4,7 +4,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
use-x11 = false; use-x11 = (import ./build.conf.nix).use-x11;
in in
{ {
nix = { nix = {
@ -70,7 +70,6 @@ in
}; };
programs.hyprland.enable = !use-x11; programs.hyprland.enable = !use-x11;
programs.sway.enable = !use-x11;
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;

View file

@ -4,8 +4,9 @@
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.home-manager.url = "github:nix-community/home-manager"; inputs.home-manager.url = "github:nix-community/home-manager";
inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs";
inputs.hyprland.url = "github:hyprwm/Hyprland";
outputs = inputs@{ self, nixpkgs, home-manager }: { outputs = inputs@{ self, nixpkgs, home-manager, hyprland, ... }: {
nixosConfigurations = { nixosConfigurations = {
nix = nixpkgs.lib.nixosSystem { nix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -20,5 +21,13 @@
]; ];
}; };
}; };
homeConfigurations."mbk@nix" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
hyprland.homeManagerModules.default
{wayland.windowManager.hyprland.enable = true;}
];
};
}; };
} }

View file

@ -1,4 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let
use-x11 = (import ./build.conf.nix).use-x11;
in
{ {
/* The home.stateVersion option does not have a default and must be set */ /* The home.stateVersion option does not have a default and must be set */
home.stateVersion = "22.05"; home.stateVersion = "22.05";
@ -104,4 +107,28 @@
enable = true; enable = true;
extraConfig = import ./kitty.conf.nix; extraConfig = import ./kitty.conf.nix;
}; };
wayland.windowManager.hyprland.extraConfig = ''
$mod = SUPER
bind = $mod, F, exec, firefox
bind = , Print, exec, grimblast copy area
# workspaces
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
${builtins.concatStringsSep "\n" (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in ''
bind = $mod, ${ws}, workspace, ${toString (x + 1)}
bind = $mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}
''
)
10)}
# ...
'';
} }