Merge branch 'main' of github.com:sajenim/dotfiles.nix

This commit is contained in:
♥ Minnie ♥ 2023-07-27 20:13:48 +08:00
commit 6a2a0ff8b7
24 changed files with 55 additions and 468 deletions

View file

@ -1,71 +1,5 @@
{ {
"nodes": { "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"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"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"
}
},
"haskell-flake_2": {
"locked": {
"lastModified": 1684069239,
"narHash": "sha256-1nPdY5KasmGwwtuKv7OKCLCZC3wlAE+hJWwKZRBAluo=",
"owner": "srid",
"repo": "haskell-flake",
"rev": "b8ccbf305e720e3483d7b983aeda61326169226a",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "haskell-flake",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -89,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1689209875, "lastModified": 1689956312,
"narHash": "sha256-8AVcBV1DiszaZzHFd5iLc8HSLfxRAuqcU0QdfBEF3Ag=", "narHash": "sha256-NV9yamMhE5jgz+ZSM2IgXeYqOvmGIbIIJ+AFIhfD7Ek=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fcc147b1e9358a8386b2c4368bd928e1f63a7df2", "rev": "6da4bc6cb07cba1b8e53d139cbf1d2fb8061d967",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -103,49 +37,13 @@
"type": "github" "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"
}
},
"nixpkgs-lib_2": {
"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"
}
},
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1689192006, "lastModified": 1690031011,
"narHash": "sha256-QM0f0d8oPphOTYJebsHioR9+FzJcy1QNIzREyubB91U=", "narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2de8efefb6ce7f5e4e75bdf57376a96555986841", "rev": "12303c652b881435065a98729eb7278313041e49",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -155,79 +53,11 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"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_3": {
"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"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable"
"xmobar-config": "xmobar-config",
"xmonad-config": "xmonad-config"
}
},
"xmobar-config": {
"inputs": {
"flake-parts": "flake-parts",
"haskell-flake": "haskell-flake",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-9yA3EWDaaAmIpotcyodU2TOU9hiKU6mGhx1CDmqab2o=",
"path": "home-manager/common/desktop/xmobar",
"type": "path"
},
"original": {
"path": "home-manager/common/desktop/xmobar",
"type": "path"
}
},
"xmonad-config": {
"inputs": {
"flake-parts": "flake-parts_2",
"haskell-flake": "haskell-flake_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-dqxTolZPIUfO01KxiKyAEWClPz1WWE15q9O5Ougoyb0=",
"path": "home-manager/common/desktop/xmonad",
"type": "path"
},
"original": {
"path": "home-manager/common/desktop/xmonad",
"type": "path"
} }
} }
}, },

View file

@ -14,10 +14,6 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Add any other flake you might need # Add any other flake you might need
# Development environments
xmonad-config.url = "path:home-manager/common/desktop/xmonad";
xmobar-config.url = "path:home-manager/common/desktop/xmobar";
}; };
outputs = { self, nixpkgs, home-manager, ... }@inputs: outputs = { self, nixpkgs, home-manager, ... }@inputs:

View file

@ -1,32 +0,0 @@
{ inputs, pkgs, ... }:
{
imports = [
./picom.nix
];
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/src/xmonad.hs;
};
home.file.".xinitrc".source = ./xinitrc;
xdg.configFile = {
wezterm = { source = ./wezterm; recursive = true; };
};
}

View file

@ -1,80 +0,0 @@
{
"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
}

View file

@ -1,46 +0,0 @@
{
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;
};
};
}

View file

@ -1,80 +0,0 @@
{
"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
}

View file

@ -1,46 +0,0 @@
{
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;
};
};
}

View file

@ -51,6 +51,7 @@
# Extra commands that should be added to '.zshrc' # Extra commands that should be added to '.zshrc'
initExtra = '' initExtra = ''
eval "$(direnv hook zsh)"
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
PROMPT='%F{blue}%n %F{cyan}%~ %F{red} %f'; PROMPT='%F{blue}%n %F{cyan}%~ %F{red} %f';
''; '';

View file

@ -12,12 +12,14 @@
# You can also split up your configuration and import pieces of it here: # You can also split up your configuration and import pieces of it here:
# User services
./services/picom
# User programs # User programs
./programs/discord ./programs/discord
./programs/mangohud ./programs/mangohud
# Common programs # Common programs
../common/desktop
../common/programs/git ../common/programs/git
../common/programs/zsh ../common/programs/zsh
../common/programs/nvim ../common/programs/nvim
@ -63,12 +65,33 @@
# Install some packages # Install some packages
packages = with pkgs; [ packages = with pkgs; [
# Stable user programs
bitwarden bitwarden
dmenu
feh
spotify spotify
prismlauncher prismlauncher
xmobar
# Unstable user programs
unstable.wezterm
]; ];
}; };
# Setup our window manager
xsession.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
config = ../../pkgs/xmonad-config/src/xmonad.hs;
};
# Copy some configuration files to $XDG_CONFIG_HOME
xdg.configFile = {
wezterm = { source = ./programs/wezterm/config; recursive = true; };
};
# Setup our desktop environment
home.file.".xinitrc".source = ./xinitrc;
# Nicely reload system units when changing configs # Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";

View file

@ -4,7 +4,7 @@
xrandr --output HDMI-A-0 --mode 1920x1080 --output DisplayPort-0 --mode 2560x1440 --right-of HDMI-A-0 xrandr --output HDMI-A-0 --mode 1920x1080 --output DisplayPort-0 --mode 2560x1440 --right-of HDMI-A-0
# Apply our wallpaper # Apply our wallpaper
feh --bg-scale ~/dotfiles.nix/assets/chinatown.png feh --bg-center ~/dotfiles.nix/assets/chinatown.png
# Enable our compositor # Enable our compositor
picom -b picom -b

View file

@ -2,5 +2,6 @@
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example' # You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
{ pkgs ? (import ../nixpkgs.nix) { } }: { { pkgs ? (import ../nixpkgs.nix) { } }: {
# example = pkgs.callPackage ./example { }; xmobar = pkgs.callPackage ./xmobar-config { };
xmonad = pkgs.callPackage ./xmonad-config { };
} }

View file

@ -0,0 +1 @@
use_nix

View file

@ -0,0 +1,5 @@
{ pkgs }:
pkgs.haskellPackages.developPackage {
root = ./.;
}

View file

@ -0,0 +1,4 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs.buildPackages; [ cabal-install ghc ];
}

View file

@ -0,0 +1 @@
use_nix

View file

@ -0,0 +1,5 @@
{ pkgs }:
pkgs.haskellPackages.developPackage {
root = ./.;
}

View file

@ -0,0 +1,4 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs.buildPackages; [ cabal-install ghc ];
}