feat(devenv): make new devenv config that integrates alejandra and commitizen
This commit is contained in:
parent
080241f63e
commit
c811d1979c
8 changed files with 413 additions and 196 deletions
3
.envrc
Normal file
3
.envrc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
|
||||||
|
|
||||||
|
use devenv
|
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Devenv
|
||||||
|
.devenv*
|
||||||
|
devenv.local.nix
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv
|
||||||
|
|
||||||
|
# pre-commit
|
||||||
|
.pre-commit-config.yaml
|
122
devenv.lock
Normal file
122
devenv.lock
Normal file
|
@ -0,0 +1,122 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"devenv": {
|
||||||
|
"locked": {
|
||||||
|
"dir": "src/modules",
|
||||||
|
"lastModified": 1723156315,
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv",
|
||||||
|
"rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91",
|
||||||
|
"treeHash": "6624b16e4203ef3eae59ce8d5d19005e04741537",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "src/modules",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1716977621,
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv-nixpkgs",
|
||||||
|
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
||||||
|
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "rolling",
|
||||||
|
"repo": "devenv-nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1722869614,
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "883180e6550c1723395a3a342f830bfc5c371f6b",
|
||||||
|
"treeHash": "e3ce01703c0d0324121e0d3ec6336275025b4ae6",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-24.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pre-commit-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1723056346,
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "3c977f1c9930f54066c085305b4b2291385e7a73",
|
||||||
|
"treeHash": "d6f89338ffb2ca32c20bc0f8d50009e1894ab804",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"devenv": "devenv",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
48
devenv.nix
Normal file
48
devenv.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# https://devenv.sh/basics/
|
||||||
|
env.GREET = "devenv";
|
||||||
|
cachix.enable = false;
|
||||||
|
# https://devenv.sh/packages/
|
||||||
|
packages = [pkgs.git];
|
||||||
|
|
||||||
|
# https://devenv.sh/languages/
|
||||||
|
# languages.rust.enable = true;
|
||||||
|
languages.nix.enable = true;
|
||||||
|
pre-commit.hooks = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
shellcheck.enable = true;
|
||||||
|
commitizen.enable = true;
|
||||||
|
};
|
||||||
|
# https://devenv.sh/processes/
|
||||||
|
# processes.cargo-watch.exec = "cargo-watch";
|
||||||
|
|
||||||
|
# https://devenv.sh/services/
|
||||||
|
# services.postgres.enable = true;
|
||||||
|
|
||||||
|
# https://devenv.sh/scripts/
|
||||||
|
scripts.hello.exec = ''
|
||||||
|
echo hello from $GREET
|
||||||
|
'';
|
||||||
|
|
||||||
|
enterShell = ''
|
||||||
|
hello
|
||||||
|
git --version
|
||||||
|
'';
|
||||||
|
|
||||||
|
# https://devenv.sh/tests/
|
||||||
|
enterTest = ''
|
||||||
|
echo "Running tests"
|
||||||
|
git --version | grep --color=auto "${pkgs.git.version}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# https://devenv.sh/pre-commit-hooks/
|
||||||
|
# pre-commit.hooks.shellcheck.enable = true;
|
||||||
|
|
||||||
|
# See full reference at https://devenv.sh/reference/options/
|
||||||
|
}
|
15
devenv.yaml
Normal file
15
devenv.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
|
||||||
|
inputs:
|
||||||
|
nixpkgs:
|
||||||
|
url: github:cachix/devenv-nixpkgs/rolling
|
||||||
|
|
||||||
|
# If you're using non-OSS software, you can set allowUnfree to true.
|
||||||
|
# allowUnfree: true
|
||||||
|
|
||||||
|
# If you're willing to use a package that's vulnerable
|
||||||
|
# permittedInsecurePackages:
|
||||||
|
# - "openssl-1.1.1w"
|
||||||
|
|
||||||
|
# If you have more than one devenv you can merge them
|
||||||
|
#imports:
|
||||||
|
# - ./backend
|
|
@ -1,107 +1,107 @@
|
||||||
#his is your home-manager configuration file
|
#his is your home-manager configuration file
|
||||||
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
{
|
# You can import other home-manager modules here
|
||||||
# You can import other home-manager modules here
|
imports = [
|
||||||
imports = [
|
# If you want to use home-manager modules from other flakes (such as nix-colors):
|
||||||
# If you want to use home-manager modules from other flakes (such as nix-colors):
|
# inputs.nix-colors.homeManagerModule
|
||||||
# inputs.nix-colors.homeManagerModule
|
|
||||||
|
|
||||||
# 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:
|
||||||
#./swaywm.nix
|
#./swaywm.nix
|
||||||
./hypr
|
./hypr
|
||||||
./shells
|
./shells
|
||||||
./variables.nix
|
./variables.nix
|
||||||
];
|
./mako.nix
|
||||||
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
# You can add overlays here
|
# You can add overlays here
|
||||||
overlays = [
|
overlays = [
|
||||||
# If you want to use overlays exported from other flakes:
|
# If you want to use overlays exported from other flakes:
|
||||||
# neovim-nightly-overlay.overlays.default
|
# neovim-nightly-overlay.overlays.default
|
||||||
|
|
||||||
# Or define it inline, for example:
|
# Or define it inline, for example:
|
||||||
# (final: prev: {
|
# (final: prev: {
|
||||||
# hi = final.hello.overrideAttrs (oldAttrs: {
|
# hi = final.hello.overrideAttrs (oldAttrs: {
|
||||||
# patches = [ ./change-hello-to-hi.patch ];
|
# patches = [ ./change-hello-to-hi.patch ];
|
||||||
# });
|
# });
|
||||||
# })
|
# })
|
||||||
];
|
];
|
||||||
# Configure your nixpkgs instance
|
# Configure your nixpkgs instance
|
||||||
config = {
|
config = {
|
||||||
# Disable if you don't want unfree packages
|
# Disable if you don't want unfree packages
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
||||||
allowUnfreePredicate = _: true;
|
allowUnfreePredicate = _: true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
username = "${config.myUserName}";
|
username = "${config.myUserName}";
|
||||||
homeDirectory = "/home/${config.myUserName}";
|
homeDirectory = "/home/${config.myUserName}";
|
||||||
file = {
|
file = {
|
||||||
"wallpaper.png".source = ./assets/gruvbox-wallpaper.png;
|
"wallpaper.png".source = ./assets/gruvbox-wallpaper.png;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.neovim.enable = true;
|
programs.neovim.enable = true;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
protonvpn-gui
|
protonvpn-gui
|
||||||
devenv
|
devenv
|
||||||
];
|
];
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.gitFull;
|
package = pkgs.gitFull;
|
||||||
userName = config.myDisplayName;
|
userName = config.myDisplayName;
|
||||||
userEmail = config.myEmail;
|
userEmail = config.myEmail;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
push.autoSetupRemote = true;
|
push.autoSetupRemote = true;
|
||||||
commit.gpgsign = true;
|
commit.gpgsign = true;
|
||||||
gpg.format = "ssh";
|
gpg.format = "ssh";
|
||||||
gpg.ssh.allowedSignersFile = "/home/${config.myUserName}/.ssh/allowed_signers";
|
gpg.ssh.allowedSignersFile = "/home/${config.myUserName}/.ssh/allowed_signers";
|
||||||
user.signingkey = "/home/${config.myUserName}/.ssh/id_ed25519.pub";
|
user.signingkey = "/home/${config.myUserName}/.ssh/id_ed25519.pub";
|
||||||
credential.helper = "libsecret";
|
credential.helper = "libsecret";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
programs.firefox.enable = true;
|
programs.firefox.enable = true;
|
||||||
# Nicely reload system units when changing configs
|
# Nicely reload system units when changing configs
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
services.kanshi = {
|
services.kanshi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles = {
|
profiles = {
|
||||||
undocked = {
|
undocked = {
|
||||||
outputs = [
|
outputs = [
|
||||||
{
|
{
|
||||||
criteria = "eDP-1";
|
criteria = "eDP-1";
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
status = "enable";
|
status = "enable";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
docked = {
|
docked = {
|
||||||
outputs = [
|
outputs = [
|
||||||
{
|
{
|
||||||
criteria = "HDMI-A-1";
|
criteria = "HDMI-A-1";
|
||||||
position = "0,0";
|
position = "0,0";
|
||||||
mode = "1920x1080@60Hz";
|
mode = "1920x1080@60Hz";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
criteria = "eDP-1";
|
criteria = "eDP-1";
|
||||||
position = "0,0";
|
position = "0,0";
|
||||||
status = "enable";
|
status = "enable";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemdTarget = "hyprland-session.target";
|
systemdTarget = "hyprland-session.target";
|
||||||
};
|
};
|
||||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||||
home.stateVersion = "24.05";
|
home.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
|
12
home-manager/stvnliu/mako.nix
Normal file
12
home-manager/stvnliu/mako.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
defaultTimeoutMillis = 5 * 1000;
|
||||||
|
in {
|
||||||
|
services.mako = {
|
||||||
|
enable = true;
|
||||||
|
defaultTimeout = defaultTimeoutMillis;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,105 +1,113 @@
|
||||||
# This is your system's configuration file.
|
# This is your system's configuration file.
|
||||||
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
{
|
imports = [
|
||||||
imports = [
|
./variables.nix
|
||||||
./variables.nix
|
#./greetd-sway.nix
|
||||||
#./greetd-sway.nix
|
./nvidia.nix
|
||||||
./nvidia.nix
|
./fonts.nix
|
||||||
./fonts.nix
|
./services/laptop.preset.nix
|
||||||
./services/laptop.preset.nix
|
./hardware-configuration.nix
|
||||||
./hardware-configuration.nix
|
];
|
||||||
];
|
|
||||||
|
|
||||||
security.pam.services.hyprlock = {};
|
|
||||||
|
|
||||||
boot.loader = {
|
security.pam.services.hyprlock = {};
|
||||||
efi.canTouchEfiVariables = true;
|
hardware.bluetooth = {
|
||||||
grub = {
|
enable = true;
|
||||||
enable = true;
|
powerOnBoot = true;
|
||||||
useOSProber = true;
|
};
|
||||||
efiSupport = true;
|
systemd.user.services.mpris-proxy = {
|
||||||
fsIdentifier = "label";
|
description = "Mpris proxy";
|
||||||
devices = [ "nodev" ];
|
after = ["network.target" "sound.target"];
|
||||||
extraEntries = ''
|
wantedBy = ["default.target"];
|
||||||
menuentry "Reboot" {
|
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
||||||
reboot
|
};
|
||||||
}
|
boot.loader = {
|
||||||
menuentry "Poweroff" {
|
efi.canTouchEfiVariables = true;
|
||||||
halt
|
grub = {
|
||||||
}
|
enable = true;
|
||||||
'';
|
useOSProber = true;
|
||||||
};
|
efiSupport = true;
|
||||||
};
|
fsIdentifier = "label";
|
||||||
services.displayManager.sddm = {
|
devices = ["nodev"];
|
||||||
enable = true;
|
extraEntries = ''
|
||||||
wayland.enable = true;
|
menuentry "Reboot" {
|
||||||
};
|
reboot
|
||||||
#systemd.user.services.kanshi = {
|
}
|
||||||
# description = "kanshi daemon";
|
menuentry "Poweroff" {
|
||||||
# serviceConfig = {
|
halt
|
||||||
# Type = "simple";
|
}
|
||||||
# ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file'';
|
'';
|
||||||
# };
|
};
|
||||||
#};
|
};
|
||||||
|
services.displayManager.sddm = {
|
||||||
|
enable = true;
|
||||||
|
wayland.enable = true;
|
||||||
|
};
|
||||||
|
#systemd.user.services.kanshi = {
|
||||||
|
# description = "kanshi daemon";
|
||||||
|
# serviceConfig = {
|
||||||
|
# Type = "simple";
|
||||||
|
# ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file'';
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
services.gnome.gnome-keyring.enable = true;
|
services.gnome.gnome-keyring.enable = true;
|
||||||
#programs.sway = {
|
#programs.sway = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
# wrapperFeatures.gtk = true;
|
# wrapperFeatures.gtk = true;
|
||||||
#};
|
#};
|
||||||
programs.hyprland.enable = true; # enables Hyprland DM.
|
programs.hyprland.enable = true; # enables Hyprland DM.
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
overlays = [
|
overlays = [
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = let
|
nix = let
|
||||||
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
||||||
in {
|
in {
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = "nix-command flakes";
|
experimental-features = "nix-command flakes";
|
||||||
flake-registry = "";
|
flake-registry = "";
|
||||||
nix-path = config.nix.nixPath;
|
nix-path = config.nix.nixPath;
|
||||||
};
|
};
|
||||||
channel.enable = false;
|
channel.enable = false;
|
||||||
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
|
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
|
||||||
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
|
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
|
||||||
};
|
};
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "${config.myHostName}";
|
hostName = "${config.myHostName}";
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
};
|
};
|
||||||
users.users = {
|
users.users = {
|
||||||
"${config.myUserName}" = {
|
"${config.myUserName}" = {
|
||||||
initialPassword = "stevenpassword";
|
initialPassword = "stevenpassword";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
];
|
];
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
nh
|
nh
|
||||||
];
|
];
|
||||||
extraGroups = ["wheel"];
|
extraGroups = ["wheel"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
PermitRootLogin = "no";
|
PermitRootLogin = "no";
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.automatic-timezoned.enable = true;
|
services.automatic-timezoned.enable = true;
|
||||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue