xmonad-projects #15
6 changed files with 85 additions and 67 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.local.wezterm;
|
cfg = config.local.wezterm;
|
||||||
|
|
|
@ -1,7 +1,41 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let themeCfg = config.local.theme; in
|
let
|
||||||
|
cfg = config.local.xmonad;
|
||||||
|
themeCfg = config.local.theme;
|
||||||
|
|
||||||
|
projectType = with lib; types.submodule {
|
||||||
|
options = {
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
startHook = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
mkXmonadProject = { name, startHook }:
|
||||||
|
''
|
||||||
|
Project {
|
||||||
|
projectName = "${name}",
|
||||||
|
projectStartHook = ${lib.removeSuffix startHook}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
xmonadProjects = lib.concatStringsSep ",\n" (map mkXmonadProject cfg.projects);
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
options.local.xmonad = with lib;
|
||||||
|
{
|
||||||
|
projects = mkOption {
|
||||||
|
type = types.listOf projectType;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xclip # access x clipboard from a console
|
xclip # access x clipboard from a console
|
||||||
dmenu # menu for x window system
|
dmenu # menu for x window system
|
||||||
|
@ -23,6 +57,7 @@ let themeCfg = config.local.theme; in
|
||||||
|
|
||||||
config = pkgs.substituteAll {
|
config = pkgs.substituteAll {
|
||||||
src = ./xmonad_config.hs;
|
src = ./xmonad_config.hs;
|
||||||
|
projects = "\n" + xmonadProjects;
|
||||||
inherit (themeCfg.bar) background mainText inactiveText;
|
inherit (themeCfg.bar) background mainText inactiveText;
|
||||||
inherit (themeCfg.window) activeBorder inactiveBorder;
|
inherit (themeCfg.window) activeBorder inactiveBorder;
|
||||||
inherit (themeCfg.highlights) critical warning success;
|
inherit (themeCfg.highlights) critical warning success;
|
||||||
|
@ -49,4 +84,5 @@ let themeCfg = config.local.theme; in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -383,29 +383,7 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) =
|
||||||
|
|
||||||
myProjects :: [Project]
|
myProjects :: [Project]
|
||||||
myProjects =
|
myProjects =
|
||||||
[ -- my work
|
[ -- @projects@
|
||||||
Project
|
|
||||||
{ projectName = "bm-back",
|
|
||||||
projectStartHook = do
|
|
||||||
let workdir = "~/projects/binarymanagement/bm-back"
|
|
||||||
spawn $ terminal' workdir $ Just "docker-compose -f docker-compose.dev.yml up -d"
|
|
||||||
replicateM_ 3 $ spawn $ terminal workdir
|
|
||||||
},
|
|
||||||
Project
|
|
||||||
{ projectName = "bm-front",
|
|
||||||
projectStartHook = do
|
|
||||||
let workdir = "~/projects/binarymanagement/bm-front"
|
|
||||||
replicateM_ 3 $ spawn $ terminal workdir
|
|
||||||
},
|
|
||||||
-- personal
|
|
||||||
Project
|
|
||||||
{ projectName = "system",
|
|
||||||
projectStartHook = replicateM_ 2 $ spawn $ terminal "~/repos/mynix/system"
|
|
||||||
},
|
|
||||||
Project
|
|
||||||
{ projectName = "neovim",
|
|
||||||
projectStartHook = replicateM_ 2 $ spawn $ terminal "~/repos/mynix/neovim"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
terminal :: String -> String
|
terminal :: String -> String
|
||||||
|
|
BIN
nixos/hosts/asus-gl553vd/xmonad_projects.secret.nix
Normal file
BIN
nixos/hosts/asus-gl553vd/xmonad_projects.secret.nix
Normal file
Binary file not shown.
|
@ -27,15 +27,17 @@ in
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
extraJanHomeModule = { lib, pkgs, ... }: {
|
extraJanHomeModule = { lib, pkgs, ... }: {
|
||||||
|
imports = [ ./home/xmonad_projects.secret.nix ];
|
||||||
|
|
||||||
home.packages = lib.mkAfter (with pkgs.unstable; [
|
home.packages = lib.mkAfter (with pkgs.unstable; [
|
||||||
# 3d programs
|
# 3d programs
|
||||||
blender
|
blender
|
||||||
cura
|
cura
|
||||||
|
godot_4
|
||||||
# electronics
|
# electronics
|
||||||
kicad-small
|
kicad-small
|
||||||
# godot
|
|
||||||
godot_4
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -58,7 +60,9 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
extraJanHomeModule = { ... }: { };
|
extraJanHomeModule = { lib, ... }: {
|
||||||
|
imports = [ ./asus-gl553vd/xmonad_projects.secret.nix ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
BIN
nixos/hosts/home/xmonad_projects.secret.nix
Normal file
BIN
nixos/hosts/home/xmonad_projects.secret.nix
Normal file
Binary file not shown.
Loading…
Reference in a new issue