diff --git a/flake.lock b/flake.lock index c3a4b4b..fd76813 100644 --- a/flake.lock +++ b/flake.lock @@ -27,7 +27,7 @@ "emacs": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1683221311, @@ -87,11 +87,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1680392223, - "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "lastModified": 1683560683, + "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "rev": "006c75898cf814ef9497252b022e91c946ba8e17", "type": "github" }, "original": { @@ -105,11 +105,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1680392223, - "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "lastModified": 1683560683, + "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "rev": "006c75898cf814ef9497252b022e91c946ba8e17", "type": "github" }, "original": { @@ -168,11 +168,11 @@ }, "haskell-flake": { "locked": { - "lastModified": 1682714267, - "narHash": "sha256-DsGj9AIKqKcWQQOuwbFU77rkehaICzISHhH7aezZ6OQ=", + "lastModified": 1684069239, + "narHash": "sha256-1nPdY5KasmGwwtuKv7OKCLCZC3wlAE+hJWwKZRBAluo=", "owner": "srid", "repo": "haskell-flake", - "rev": "a904caac3e4638f84a28102762bf767dd1ae50c0", + "rev": "b8ccbf305e720e3483d7b983aeda61326169226a", "type": "github" }, "original": { @@ -183,11 +183,11 @@ }, "haskell-flake_2": { "locked": { - "lastModified": 1682714267, - "narHash": "sha256-DsGj9AIKqKcWQQOuwbFU77rkehaICzISHhH7aezZ6OQ=", + "lastModified": 1684069239, + "narHash": "sha256-1nPdY5KasmGwwtuKv7OKCLCZC3wlAE+hJWwKZRBAluo=", "owner": "srid", "repo": "haskell-flake", - "rev": "a904caac3e4638f84a28102762bf767dd1ae50c0", + "rev": "b8ccbf305e720e3483d7b983aeda61326169226a", "type": "github" }, "original": { @@ -217,82 +217,18 @@ "type": "github" } }, - "jade": { - "flake": false, - "locked": { - "lastModified": 1683306042, - "narHash": "sha256-ZZlSojpMVQPMG2iHX47g/vGdJclS67W52OYsI+wVilI=", - "owner": "sajenim", - "repo": "jade", - "rev": "d1b6f87a064f5f6ee3d4c134caafb3d12acde08f", - "type": "github" - }, - "original": { - "owner": "sajenim", - "repo": "jade", - "type": "github" - } - }, - "master": { - "locked": { - "lastModified": 1683302933, - "narHash": "sha256-REz0CBw7tqIy/w1HBPWvzebHpEJEYbcf8tc0zg7qes4=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "36226e3b93c5e7db9110392fb0242ca95c331530", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "master", - "repo": "nixpkgs", - "type": "github" - } - }, - "neovim-jsm": { - "flake": false, - "locked": { - "lastModified": 1683595289, - "narHash": "sha256-k4VPAFJ54Vf2v2jEV1v3F6MWnppHxXc7783pXHWHtFo=", - "owner": "sajenim", - "repo": "neovim-jsm", - "rev": "7b97c46ba7fc6f100d397eaee2a2d40ab238c591", - "type": "github" - }, - "original": { - "owner": "sajenim", - "repo": "neovim-jsm", - "type": "github" - } - }, - "nixos-unstable": { - "locked": { - "lastModified": 1683194677, - "narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0d8145a5d81ebf6698077b21042380a3a66a11c7", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1673540789, - "narHash": "sha256-xqnxBOK3qctIeUVxecydrEDbEXjsvHCPGPbvsl63M/U=", - "owner": "NixOS", + "lastModified": 1683928319, + "narHash": "sha256-maz0DRKixJVcNRMiAMWlJniiF8IuQ+WbfmlJJ8D+jfM=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "0f213d0fee84280d8c3a97f7469b988d6fe5fcdf", + "rev": "9656e85a15a0fe67847ee8cdb99a20d8df499962", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", + "owner": "nixos", + "ref": "nixos-22.11", "repo": "nixpkgs", "type": "github" } @@ -301,7 +237,7 @@ "inputs": { "crane": "crane", "emacs": "emacs", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-fmt": "nixpkgs-fmt", "river-src": "river-src", "wezterm-src": "wezterm-src" @@ -346,11 +282,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1680213900, - "narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e3652e0735fbec227f342712f180f4f21f0594f2", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", "type": "github" }, "original": { @@ -364,11 +300,11 @@ "nixpkgs-lib_2": { "locked": { "dir": "lib", - "lastModified": 1680213900, - "narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e3652e0735fbec227f342712f180f4f21f0594f2", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", "type": "github" }, "original": { @@ -381,21 +317,37 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1683267615, - "narHash": "sha256-A/zAy9YauwdPut90h6cYC1zgP/WmuW9zmJ+K/c5i6uc=", + "lastModified": 1684049129, + "narHash": "sha256-7WB9LpnPNAS8oI7hMoHeKLNhRX7k3CI9uWBRSfmOCCE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0b6445b611472740f02eae9015150c07c5373340", + "rev": "0470f36b02ef01d4f43c641bbf07020bcab71bf1", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { + "locked": { + "lastModified": 1673540789, + "narHash": "sha256-xqnxBOK3qctIeUVxecydrEDbEXjsvHCPGPbvsl63M/U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0f213d0fee84280d8c3a97f7469b988d6fe5fcdf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1683250446, "narHash": "sha256-poBkMQ0q7X2xH5hAqLYmsly0NGbC6zDCUnrwOXIxo50=", @@ -411,13 +363,13 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1682779028, - "narHash": "sha256-tFfSbwSLobpHRznAa35KEU3R+fsFWTlmpFhTUdXq8RE=", + "lastModified": 1684120848, + "narHash": "sha256-gIwJ5ac1FwZEkCRwjY+gLwgD4G1Bw3Xtr2jr2XihMPo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "54abe781c482f51ff4ff534ebaba77db5bd97442", + "rev": "0cb867999eec4085e1c9ca61c09b72261fa63bb4", "type": "github" }, "original": { @@ -427,13 +379,13 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { - "lastModified": 1682779028, - "narHash": "sha256-tFfSbwSLobpHRznAa35KEU3R+fsFWTlmpFhTUdXq8RE=", + "lastModified": 1684120848, + "narHash": "sha256-gIwJ5ac1FwZEkCRwjY+gLwgD4G1Bw3Xtr2jr2XihMPo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "54abe781c482f51ff4ff534ebaba77db5bd97442", + "rev": "0cb867999eec4085e1c9ca61c09b72261fa63bb4", "type": "github" }, "original": { @@ -464,18 +416,11 @@ "root": { "inputs": { "home-manager": "home-manager", - "jade": "jade", - "master": "master", - "neovim-jsm": "neovim-jsm", - "nixos-unstable": "nixos-unstable", - "nixpkgs": [ - "nixos-unstable" - ], + "nixpkgs": "nixpkgs", "nixpkgs-f2k": "nixpkgs-f2k", "nixpkgs-unstable": "nixpkgs-unstable", - "stable": "stable", - "xmobar-jsm": "xmobar-jsm", - "xmonad-jsm": "xmonad-jsm" + "xmobar-config": "xmobar-config", + "xmonad-config": "xmonad-config" } }, "rust-analyzer-src": { @@ -522,22 +467,6 @@ "type": "github" } }, - "stable": { - "locked": { - "lastModified": 1683207485, - "narHash": "sha256-gs+PHt/y/XQB7S8+YyBLAM8LjgYpPZUVFQBwpFSmJro=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "cc45a3f8c98e1c33ca996e3504adefbf660a72d1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -572,44 +501,38 @@ "url": "https://github.com/wez/wezterm.git" } }, - "xmobar-jsm": { + "xmobar-config": { "inputs": { "flake-parts": "flake-parts", "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1682990712, - "narHash": "sha256-T50x69VeO/ZOF/FT4sY/sZ6tpILSv0wAhvnUwxtO/jA=", - "owner": "sajenim", - "repo": "xmobar-jsm", - "rev": "29a52ad859b46eb8fdd08993c953a45c1cab1c93", - "type": "github" - }, - "original": { - "owner": "sajenim", - "repo": "xmobar-jsm", - "type": "github" - } - }, - "xmonad-jsm": { - "inputs": { - "flake-parts": "flake-parts_2", - "haskell-flake": "haskell-flake_2", "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1683305153, - "narHash": "sha256-nDBJypiQMpeoch9DHNM23yLqhBWrcFkdL+zeIYks1bo=", - "owner": "sajenim", - "repo": "xmonad-jsm", - "rev": "c461890b1d35d4e05acccacb1965cbaf45a415b8", - "type": "github" + "lastModified": 1, + "narHash": "sha256-9yA3EWDaaAmIpotcyodU2TOU9hiKU6mGhx1CDmqab2o=", + "path": "home-manager/common/jade/xmobar/xmobar-config", + "type": "path" }, "original": { - "owner": "sajenim", - "repo": "xmonad-jsm", - "type": "github" + "path": "home-manager/common/jade/xmobar/xmobar-config", + "type": "path" + } + }, + "xmonad-config": { + "inputs": { + "flake-parts": "flake-parts_2", + "haskell-flake": "haskell-flake_2", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-E4BkxlATBwtD2VV2R9RU27T7ih7NCvif/n50RV6mgiY=", + "path": "home-manager/common/jade/xmonad/xmonad-config", + "type": "path" + }, + "original": { + "path": "home-manager/common/jade/xmonad/xmonad-config", + "type": "path" } } }, diff --git a/flake.nix b/flake.nix index b77178c..c8c5fbb 100644 --- a/flake.nix +++ b/flake.nix @@ -2,40 +2,23 @@ description = "NixOS + Home Manager configuration with flakes"; inputs = { - # Nixpkgs branches - master.url = "github:nixos/nixpkgs/master"; - stable.url = "github:nixos/nixpkgs/nixos-22.11"; - nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + # Nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + # You can access packages and modules from different nixpkgs revs + # at the same time. Here's an working example: + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. # Home manager home-manager.url = "github:nix-community/home-manager/master"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; # Add any other flake you might need nixpkgs-f2k.url = "github:fortuneteller2k/nixpkgs-f2k"; - # My personal flakes - xmonad-jsm.url = "github:sajenim/xmonad-jsm"; - # xmonad-jsm.url = "path:/home/sajenim/xmonad-jsm"; - xmobar-jsm.url = "github:sajenim/xmobar-jsm"; - # xmobar-jsm.url = "path:/home/sajenim/xmobar-jsm"; - - # Github repos - jade = { - url = "github:sajenim/jade"; - # url = "path:/home/sajenim/Projects/jade"; - flake = false; - }; - - neovim-jsm = { - url = "github:sajenim/neovim-jsm"; - # url = "path:/home/sajenim/Projects/neovim-jsm"; - flake = false; - }; - - # Default branch - nixpkgs.follows = "nixos-unstable"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + # Developer environments + xmonad-config.url = "path:home-manager/common/jade/xmonad/xmonad-config"; + xmobar-config.url = "path:home-manager/common/jade/xmobar/xmobar-config"; }; outputs = { self, nixpkgs, home-manager, ... }@inputs: @@ -100,7 +83,7 @@ extraSpecialArgs = { inherit inputs outputs; }; modules = [ # > Our main home-manager configuration file < - ./home-manager/sajenim.nix + ./home-manager/sajenim/home.nix ]; }; @@ -108,7 +91,7 @@ pkgs = nixpkgs.legacyPackages.aarch64-linux; extraSpecialArgs = { inherit inputs outputs; }; modules = [ - ./home-manager/admin.nix + ./home-manager/admin/home.nix ]; }; }; diff --git a/home-manager/admin.nix b/home-manager/admin/home.nix similarity index 100% rename from home-manager/admin.nix rename to home-manager/admin/home.nix diff --git a/home-manager/common/jade/default.nix b/home-manager/common/jade/default.nix new file mode 100644 index 0000000..1fd7a1c --- /dev/null +++ b/home-manager/common/jade/default.nix @@ -0,0 +1,30 @@ +{ inputs, pkgs, ... }: + +{ + imports = [ ]; + + nixpkgs.overlays = [ + (final: prev: { + xmobar = inputs.xmobar-config.packages.${pkgs.system}.xmobar-config; + }) + ]; + + home.packages = with pkgs; [ + dmenu + feh + unstable.wezterm + xmobar + ]; + + xsession.windowManager.xmonad = { + enable = true; + enableContribAndExtras = true; + config = ./xmonad/xmonad-config/src/xmonad.hs; + }; + + home.file.".xinitrc".source = ./xinitrc; + + xdg.configFile = { + wezterm = { source = ./wezterm; recursive = true; }; + }; +} diff --git a/config/wezterm/colors/gruvbox_material_dark_hard.toml b/home-manager/common/jade/wezterm/colors/gruvbox_material_dark_hard.toml similarity index 100% rename from config/wezterm/colors/gruvbox_material_dark_hard.toml rename to home-manager/common/jade/wezterm/colors/gruvbox_material_dark_hard.toml diff --git a/config/wezterm/wezterm.lua b/home-manager/common/jade/wezterm/wezterm.lua similarity index 100% rename from config/wezterm/wezterm.lua rename to home-manager/common/jade/wezterm/wezterm.lua diff --git a/home-manager/common/jade/xinitrc b/home-manager/common/jade/xinitrc new file mode 100644 index 0000000..b87c514 --- /dev/null +++ b/home-manager/common/jade/xinitrc @@ -0,0 +1,10 @@ +#/bin/bash + +# Setup our monitors +xrandr --output HDMI-A-0 --mode 1920x1080 --output DisplayPort-0 --mode 2560x1440 --right-of HDMI-A-0 + +# Apply our wallpaper +feh --bg-scale /etc/nixos/assets/chinatown.png + +# Launch our window manager +exec xmonad diff --git a/home-manager/common/jade/xmobar/xmobar-config/flake.lock b/home-manager/common/jade/xmobar/xmobar-config/flake.lock new file mode 100644 index 0000000..e9476dc --- /dev/null +++ b/home-manager/common/jade/xmobar/xmobar-config/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1683560683, + "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "006c75898cf814ef9497252b022e91c946ba8e17", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "haskell-flake": { + "locked": { + "lastModified": 1684069239, + "narHash": "sha256-1nPdY5KasmGwwtuKv7OKCLCZC3wlAE+hJWwKZRBAluo=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "b8ccbf305e720e3483d7b983aeda61326169226a", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "haskell-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1684120848, + "narHash": "sha256-gIwJ5ac1FwZEkCRwjY+gLwgD4G1Bw3Xtr2jr2XihMPo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0cb867999eec4085e1c9ca61c09b72261fa63bb4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "haskell-flake": "haskell-flake", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/common/jade/xmobar/xmobar-config/flake.nix b/home-manager/common/jade/xmobar/xmobar-config/flake.nix new file mode 100644 index 0000000..933070c --- /dev/null +++ b/home-manager/common/jade/xmobar/xmobar-config/flake.nix @@ -0,0 +1,46 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + haskell-flake.url = "github:srid/haskell-flake"; + }; + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = nixpkgs.lib.systems.flakeExposed; + imports = [ inputs.haskell-flake.flakeModule ]; + + perSystem = { self', pkgs, ... }: { + + # Typically, you just want a single project named "default". But + # multiple projects are also possible, each using different GHC version. + haskellProjects.default = { + # If you have a .cabal file in the root, this option is determined + # automatically. Otherwise, specify all your local packages here. + packages.xmobar-config.root = ./.; + + # The base package set representing a specific GHC version. + # By default, this is pkgs.haskellPackages. + # You may also create your own. See https://haskell.flake.page/package-set + # basePackages = pkgs.haskellPackages; + + # Dependency overrides go here. See https://haskell.flake.page/dependency + # source-overrides = { }; + # overrides = self: super: { }; + + # devShell = { + # # Enabled by default + # enable = true; + # + # # Programs you want to make available in the shell. + # # Default programs can be disabled by setting to 'null' + # tools = hp: { fourmolu = hp.fourmolu; ghcid = null; }; + # + # hlsCheck.enable = true; + # }; + }; + + # haskell-flake doesn't set the default package, but you can do it here. + packages.default = self'.packages.xmobar-config; + }; + }; +} diff --git a/home-manager/common/jade/xmobar/xmobar-config/src/xmobar-top.hs b/home-manager/common/jade/xmobar/xmobar-config/src/xmobar-top.hs new file mode 100644 index 0000000..64424fa --- /dev/null +++ b/home-manager/common/jade/xmobar/xmobar-config/src/xmobar-top.hs @@ -0,0 +1,47 @@ +import Xmobar + +-- | Configuration +config :: Config +config = defaultConfig + -- general settings + { font = "Fira Code Semi Bold 9" + , additionalFonts = [ "Symbols Nerd Font 2048-em 24" ] + , bgColor = bg1 + , fgColor = fg0 + , position = Static { xpos = 1920, ypos = 0, width = 2560, height = 24 } + -- commands to run + , commands = + [ Run $ XPropertyLog "_XMONAD_LOG_1" + , Run $ Com "uname" ["-r","-s"] "" 0 + , Run $ Date "%a %b %_d %Y %H:%M:%S" "date" 10 + , Run $ Weather "YPJT" + [ "-t", "Temp: C | Wind: km/h | Humidity: %" ] + 18000 + ] + -- format our bar + , sepChar = "%" + , alignSep = "}{" + , template = "\59255 %uname% |%_XMONAD_LOG_1%}{%YPJT% | %date%" + } + +-- | Gruvbox material +bg0, bg1, fg0, fg1, red, orange, yellow, green, aqua, blue, purple :: String +-- backgrounds +bg0 = "#1d2021" +bg1 = "#282828" +-- foregrounds +fg0 = "#d4be98" +fg1 = "#ddc7a1" +-- greys +grey0 = "#7c6f64" +-- colors +red = "#ea6962" +orange = "#e78a4e" +yellow = "#d8a658" +green = "#a9b665" +aqua = "#89b482" +blue = "#7daea3" +purple = "#d3869b" + +main :: IO () +main = configFromArgs config >>= xmobar diff --git a/home-manager/common/jade/xmobar/xmobar-config/xmobar-config.cabal b/home-manager/common/jade/xmobar/xmobar-config/xmobar-config.cabal new file mode 100644 index 0000000..b1ec891 --- /dev/null +++ b/home-manager/common/jade/xmobar/xmobar-config/xmobar-config.cabal @@ -0,0 +1,18 @@ +cabal-version: 3.0 +name: xmobar-config +version: 0.1.0.0 +synopsis: A Minimalistic Text Based Status Bar +description: my xmobar configuration +license: BSD-3-Clause +author: sajenim +maintainer: its.jassy@pm.me +build-type: Simple + +executable xmobar-top + main-is: xmobar-top.hs + hs-source-dirs: src + ghc-options: -Wall -threaded + build-depends: base, + xmobar + default-language: Haskell2010 + diff --git a/home-manager/common/jade/xmonad/xmonad-config/flake.lock b/home-manager/common/jade/xmonad/xmonad-config/flake.lock new file mode 100644 index 0000000..e9476dc --- /dev/null +++ b/home-manager/common/jade/xmonad/xmonad-config/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1683560683, + "narHash": "sha256-XAygPMN5Xnk/W2c1aW0jyEa6lfMDZWlQgiNtmHXytPc=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "006c75898cf814ef9497252b022e91c946ba8e17", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "haskell-flake": { + "locked": { + "lastModified": 1684069239, + "narHash": "sha256-1nPdY5KasmGwwtuKv7OKCLCZC3wlAE+hJWwKZRBAluo=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "b8ccbf305e720e3483d7b983aeda61326169226a", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "haskell-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1684120848, + "narHash": "sha256-gIwJ5ac1FwZEkCRwjY+gLwgD4G1Bw3Xtr2jr2XihMPo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0cb867999eec4085e1c9ca61c09b72261fa63bb4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1682879489, + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "haskell-flake": "haskell-flake", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/common/jade/xmonad/xmonad-config/flake.nix b/home-manager/common/jade/xmonad/xmonad-config/flake.nix new file mode 100644 index 0000000..982fedc --- /dev/null +++ b/home-manager/common/jade/xmonad/xmonad-config/flake.nix @@ -0,0 +1,46 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + haskell-flake.url = "github:srid/haskell-flake"; + }; + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = nixpkgs.lib.systems.flakeExposed; + imports = [ inputs.haskell-flake.flakeModule ]; + + perSystem = { self', pkgs, ... }: { + + # Typically, you just want a single project named "default". But + # multiple projects are also possible, each using different GHC version. + haskellProjects.default = { + # If you have a .cabal file in the root, this option is determined + # automatically. Otherwise, specify all your local packages here. + packages.xmonad-config.root = ./.; + + # The base package set representing a specific GHC version. + # By default, this is pkgs.haskellPackages. + # You may also create your own. See https://haskell.flake.page/package-set + # basePackages = pkgs.haskellPackages; + + # Dependency overrides go here. See https://haskell.flake.page/dependency + # source-overrides = { }; + # overrides = self: super: { }; + + # devShell = { + # # Enabled by default + # enable = true; + # + # # Programs you want to make available in the shell. + # # Default programs can be disabled by setting to 'null' + # tools = hp: { fourmolu = hp.fourmolu; ghcid = null; }; + # + # hlsCheck.enable = true; + # }; + }; + + # haskell-flake doesn't set the default package, but you can do it here. + packages.default = self'.packages.xmonad-config; + }; + }; +} diff --git a/home-manager/common/jade/xmonad/xmonad-config/src/xmonad.hs b/home-manager/common/jade/xmonad/xmonad-config/src/xmonad.hs new file mode 100644 index 0000000..0fad621 --- /dev/null +++ b/home-manager/common/jade/xmonad/xmonad-config/src/xmonad.hs @@ -0,0 +1,154 @@ +-- Base +import XMonad +import System.Exit +import qualified XMonad.StackSet as W + +-- Actions +import XMonad.Actions.CycleWS + +-- Hooks +import XMonad.Hooks.EwmhDesktops + +-- Layouts +import XMonad.Layout.ThreeColumns + +-- Layout modifiers +import XMonad.Layout.Spacing +import XMonad.Layout.Renamed +import XMonad.Layout.NoBorders + +-- Utilities +import XMonad.Util.EZConfig (additionalKeysP) + +-- xmobar dependencies +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import XMonad.Util.Loggers + +-- | Configuration +myTerminal = "wezterm" +myModMask = mod4Mask +myBorderWidth = 5 +myNormalBorderColor = "#282828" +myFocusedBorderColor = "#282828" +myWorkspaces = ["code", "chat", "web", "games", "misc"] + +-- | Keybindings +myKeys = + -- launching and killing programs + [ ("M-n" , spawn myTerminal ) -- %! Launch terminal + , ("M-e" , spawn "dmenu_run" ) -- %! Launch dmenu + , ("M-C-w" , kill ) -- %! Close the focused window + -- layouts + , ("M-" , sendMessage NextLayout ) -- %! Rotate through the available layout algorithms + -- move focus up or down the window stack + , ("M-" , windows W.focusDown ) -- %! Move focus to the next window + , ("M-" , windows W.focusUp ) -- %! Move focus to the previous window + , ("M-" , windows W.focusMaster ) -- %! Move focus to the master window + -- modifying the window order + , ("M-S-" , windows W.swapDown ) -- %! Swap the focused window with the next window + , ("M-S-" , windows W.swapUp ) -- %! Swap the focused window with the previous window + , ("M-S-" , windows W.swapMaster ) -- %! Swap the focused window with the master window + -- resizing the master/slave ratio + , ("M-" , sendMessage Expand ) -- %! Expand the master area + , ("M-" , sendMessage Shrink ) -- %! Shrink the master area + -- number of windows in the master area + , ("M-S-" , sendMessage (IncMasterN 1) ) -- %! Increase the number of windows in the master area + , ("M-S-", sendMessage (IncMasterN (-1)) ) -- %! Decrease the number of windows in the master area + -- floating layer support + , ("M-t" , withFocused $ windows . W.sink ) -- %! Push window back into tiling + -- workspace navigation + , ("M-" , moveTo Next hiddenWS ) -- %! Move focus to the next hidden workspace + , ("M-" , moveTo Prev hiddenWS ) -- %! Move focus to the previous hidden workspace + -- move window to workspace + , ("M-S-" , shiftTo Next hiddenWS ) -- %! Move focused window to the next hidden workspace + , ("M-S-