poking at dev
This commit is contained in:
parent
d842d2a230
commit
715835d743
8 changed files with 239 additions and 8 deletions
7
.envrc
Normal file
7
.envrc
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
export DIRENV_WARN_TIMEOUT=20s
|
||||||
|
|
||||||
|
eval "$(devenv direnvrc)"
|
||||||
|
|
||||||
|
# The use_devenv function supports passing flags to the devenv command
|
||||||
|
# For example: use devenv --impure --option services.postgres.enable:bool true
|
||||||
|
use devenv
|
||||||
13
.gitignore
vendored
13
.gitignore
vendored
|
|
@ -1 +1,12 @@
|
||||||
result
|
result
|
||||||
|
.stfolder
|
||||||
|
# Devenv
|
||||||
|
.devenv*
|
||||||
|
devenv.local.nix
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv
|
||||||
|
|
||||||
|
# pre-commit
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
|
||||||
|
|
|
||||||
27
.gitlab-ci.yml
Normal file
27
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
stages:
|
||||||
|
- check
|
||||||
|
- eval
|
||||||
|
|
||||||
|
variables:
|
||||||
|
NIX_CONFIG: "experimental-features = nix-command flakes"
|
||||||
|
|
||||||
|
.default_nix:
|
||||||
|
image: nixos/nix
|
||||||
|
before_script:
|
||||||
|
- nix --version
|
||||||
|
- nix flake show
|
||||||
|
- echo "Using host: $(hostname)"
|
||||||
|
|
||||||
|
flake-check:
|
||||||
|
stage: check
|
||||||
|
extends: .default_nix
|
||||||
|
script:
|
||||||
|
- nix flake check --all-systems
|
||||||
|
|
||||||
|
flake-eval:
|
||||||
|
stage: eval
|
||||||
|
extends: .default_nix
|
||||||
|
script:
|
||||||
|
- nix flake show
|
||||||
|
- nix eval .#nixosConfigurations.tower.config.system.build.toplevel.outPath
|
||||||
|
- nix eval .#nixosConfigurations.electra.config.system.build.toplevel.outPath
|
||||||
103
devenv.lock
Normal file
103
devenv.lock
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"devenv": {
|
||||||
|
"locked": {
|
||||||
|
"dir": "src/modules",
|
||||||
|
"lastModified": 1753201456,
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv",
|
||||||
|
"rev": "39662b2c5b94ad06573c9aac4fe9f671260d1587",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "src/modules",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747046372,
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1750779888,
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"git-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1750441195,
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "devenv-nixpkgs",
|
||||||
|
"rev": "0ceffe312871b443929ff3006960d29b120dc627",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "rolling",
|
||||||
|
"repo": "devenv-nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"devenv": "devenv",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"pre-commit-hooks": [
|
||||||
|
"git-hooks"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
45
devenv.nix
Normal file
45
devenv.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{ pkgs, lib, config, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# https://devenv.sh/basics/
|
||||||
|
env.GREET = "devenv";
|
||||||
|
|
||||||
|
# https://devenv.sh/packages/
|
||||||
|
packages = [ pkgs.git ];
|
||||||
|
|
||||||
|
# https://devenv.sh/languages/
|
||||||
|
# languages.rust.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/tasks/
|
||||||
|
# tasks = {
|
||||||
|
# "myproj:setup".exec = "mytool build";
|
||||||
|
# "devenv:enterShell".after = [ "myproj:setup" ];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# https://devenv.sh/tests/
|
||||||
|
enterTest = ''
|
||||||
|
echo "Running tests"
|
||||||
|
nix flake check --all-systems
|
||||||
|
'';
|
||||||
|
|
||||||
|
# https://devenv.sh/git-hooks/
|
||||||
|
# git-hooks.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
|
||||||
|
|
@ -18,9 +18,22 @@
|
||||||
grep = "rg";
|
grep = "rg";
|
||||||
cat = "bat";
|
cat = "bat";
|
||||||
tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0";
|
tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0";
|
||||||
nixos-switch = "sudo nixos-rebuild switch --flake .#${hostName}";
|
|
||||||
nixos-test = "sudo nixos-rebuild build-vm --flake .#${hostName}";
|
# NixOS commands
|
||||||
|
nixoss = "sudo nixos-rebuild switch --flake .#${hostName}";
|
||||||
|
nixos-main = "git checkout main && git pull && sudo nixos-rebuild switch --flake .#${hostName}";
|
||||||
|
nixossr = "sudo nixos-rebuild switch --flake .#${hostName} && reboot";
|
||||||
|
nixost = "sudo nixos-rebuild build-vm --flake .#${hostName}";
|
||||||
|
|
||||||
|
# Development commands
|
||||||
|
devt = "devenv test";
|
||||||
|
devs = "devenv shell";
|
||||||
|
devu = "devenv up";
|
||||||
|
devi = "nix flake init -t path:/home/alisceon/Templates/devenv#python";
|
||||||
|
|
||||||
pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/";
|
pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/";
|
||||||
|
|
||||||
|
# Tower commands
|
||||||
weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot";
|
weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot";
|
||||||
};
|
};
|
||||||
}; # end fish
|
}; # end fish
|
||||||
|
|
@ -30,6 +43,7 @@
|
||||||
userEmail = "alisceon@protonmail.com";
|
userEmail = "alisceon@protonmail.com";
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
push = { autoSetupRemote = true; };
|
push = { autoSetupRemote = true; };
|
||||||
|
init.defaultBranch = "main";
|
||||||
};
|
};
|
||||||
}; # end git
|
}; # end git
|
||||||
vscode.enable = true;
|
vscode.enable = true;
|
||||||
|
|
@ -75,6 +89,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}; # end ssh
|
}; # end ssh
|
||||||
|
direnv = {
|
||||||
|
enable = true;
|
||||||
|
silent = true;
|
||||||
|
}; # end direnv
|
||||||
}; # end programs
|
}; # end programs
|
||||||
|
|
||||||
# obsidian special case
|
# obsidian special case
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,16 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings = {
|
||||||
nix.settings.auto-optimise-store = true;
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
auto-optimise-store = true;
|
||||||
|
trusted-users = [ "root" "alisceon" ];
|
||||||
|
}; # end nix settings
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 7d";
|
options = "--delete-older-than 7d";
|
||||||
};
|
}; # end nix gc
|
||||||
|
|
||||||
console.keyMap = "sv-latin1";
|
console.keyMap = "sv-latin1";
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
@ -91,9 +94,10 @@
|
||||||
# Browser
|
# Browser
|
||||||
firefox
|
firefox
|
||||||
|
|
||||||
# Editor
|
# Development
|
||||||
vscode
|
vscode
|
||||||
obsidian
|
devenv
|
||||||
|
direnv
|
||||||
|
|
||||||
# Virtualization
|
# Virtualization
|
||||||
podman
|
podman
|
||||||
|
|
@ -108,6 +112,7 @@
|
||||||
steam
|
steam
|
||||||
krita
|
krita
|
||||||
edk2-uefi-shell
|
edk2-uefi-shell
|
||||||
|
obsidian
|
||||||
];
|
];
|
||||||
environment.shells = with pkgs; [ fish ];
|
environment.shells = with pkgs; [ fish ];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue