Compare commits

..

No commits in common. "566786f577734d2aa3123f037d4300a90229a4dd" and "3671e2adfddf86ca59f82ff4d0b8036fd8d436f5" have entirely different histories.

9 changed files with 21 additions and 129 deletions

1
.envrc
View file

@ -1,4 +1,3 @@
#! /usr/bin/env bash
# make this point to wherever your own es25519 ssh key is # make this point to wherever your own es25519 ssh key is
SOPS_AGE_KEY=$(ssh-to-age -i ~/.ssh/id_ed25519 -private-key) SOPS_AGE_KEY=$(ssh-to-age -i ~/.ssh/id_ed25519 -private-key)
export SOPS_AGE_KEY export SOPS_AGE_KEY

View file

@ -4,34 +4,22 @@ from pathlib import Path
import subprocess import subprocess
from socket import gethostname from socket import gethostname
import colors import colors
from typing import Mapping
def format_link(link: str, text: str) -> str: def format_link(link: str, text: str) -> str:
return f"\033]8;;{link}\033\\{text}\033]8;;\033\\" return f"\033]8;;{link}\033\\{text}\033]8;;\033\\"
def get_environment() -> dict[str, str]: def run(cmd: list[str], cwd: Path = Path.cwd(), exit_on_error: bool = True, **kwargs) -> subprocess.CompletedProcess:
env = dict(environ)
env["DIRENV_DISABLE"] = "1"
return env
def run(cmd: list[str], cwd: Path = Path.cwd(), exit_on_error: bool = True, env: dict[str, str] | None = None, **kwargs) -> subprocess.CompletedProcess:
if not env:
env = get_environment()
c = colors.Colors c = colors.Colors
print(f"{c.GREEN}Running command: {c.PURPLE}'{' '.join(cmd)}'{c.END}") print(f"{c.GREEN}Running command: {c.PURPLE}'{' '.join(cmd)}'{c.END}")
if cwd != Path.cwd(): if cwd != Path.cwd():
print(f"{c.GREEN} 󱞩 in directory: {c.YELLOW}'{format_link(link="file://" + str(cwd), text=cwd)}'{c.END}") print(f"{c.GREEN} 󱞩 in directory: {c.YELLOW}'{format_link(link="file://" + str(cwd), text=cwd)}'{c.END}")
result = subprocess.run(cmd, cwd=cwd, check=False, **kwargs)
result = subprocess.run(cmd, cwd=cwd, check=False, env=env, **kwargs)
if result.returncode != 0: if result.returncode != 0:
print(f"{c.RED}Command exited with non-zero exit code {c.CYAN}{c.BOLD}{result.returncode}{c.END}") print(f"{c.RED}Command exited with non-zero exit code {c.CYAN}{c.BOLD}{result.returncode}{c.END}")
if exit_on_error is True: if exit_on_error is True:
result.check_returncode() result.check_returncode()
else: else:
print(f"{c.GREEN}Command exited with exit code {c.CYAN}{c.BOLD}{result.returncode}{c.END}") print(f"{c.GREEN}Command exited with exit code {c.CYAN}{c.BOLD}{result.returncode}{c.END}")
return result return result
@aliases.register @aliases.register
@ -61,13 +49,6 @@ def _vm(args):
@aliases.register @aliases.register
def _upd(args: list): def _upd(args: list):
path = Path("/etc/nixos") path = Path("/etc/nixos")
possible_subcommands = ("switch", "boot")
subcommand = "switch"
for arg in args:
if arg in possible_subcommands:
subcommand = arg
args.remove(arg)
break
if path.exists(): if path.exists():
c = colors.Colors c = colors.Colors
files_to_delete = { files_to_delete = {
@ -76,7 +57,7 @@ def _upd(args: list):
} }
if not "--no-pull" in args: if not "--no-pull" in args:
print(f"{c.BLUE}Pulling {c.YELLOW}NixOS{c.BLUE} configuration from remote{c.END}") print(f"{c.BLUE}Pulling {c.YELLOW}NixOS{c.BLUE} configuration from remote{c.END}")
run(["git", "pull"], cwd=path) run["git", "pull", cwd=path]
else: else:
args.remove("--no-pull") args.remove("--no-pull")
if "--rewrite-hardware-configuration" in args: if "--rewrite-hardware-configuration" in args:
@ -103,7 +84,7 @@ def _upd(args: list):
args.append("--impure") args.append("--impure")
if "--impure" in args: if "--impure" in args:
print(f"{c.RED}WARNING: The --impure flag is set!{c.END}") print(f"{c.RED}WARNING: The --impure flag is set!{c.END}")
run(["sudo", "nixos-rebuild", subcommand, *args], cwd=path) run(["sudo", "nixos-rebuild", "switch", *args], cwd=path)
@aliases.register @aliases.register
def _lock(args): def _lock(args):

View file

@ -420,9 +420,7 @@ rec {
ru = true; ru = true;
}; };
"terminal.integrated.defaultProfile.linux" = "xonsh"; "terminal.integrated.defaultProfile.linux" = "xonsh";
"terminal.integrated.inheritEnv" = "true";
"explorer.confirmPasteNative" = false; "explorer.confirmPasteNative" = false;
"editor.formatOnSave" = true;
"editor.renderWhitespace" = "none"; "editor.renderWhitespace" = "none";
"explorer.fileNesting.patterns" = { "explorer.fileNesting.patterns" = {
"*.ts" = "\${capture}.js"; "*.ts" = "\${capture}.js";

View file

@ -1,12 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ { pkgs, config, hostname, ... }:
pkgs,
config,
hostname,
...
}:
{ {
nix = { nix = {
settings = { settings = {
@ -137,27 +132,17 @@
# programs.mtr.enable = true; # programs.mtr.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
# enableSSHSupport = true; enableSSHSupport = true;
enableExtraSocket = true; # VSCode devcontainers require this
};
programs.ssh = {
startAgent = true;
extraConfig = ''
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
'';
}; };
# PAM modules # PAM modules
security.pam = { security.pam = {
loginLimits = [ loginLimits = [{
{
domain = "*"; domain = "*";
type = "soft"; type = "soft";
item = "nofile"; item = "nofile";
value = 8192; value = 8192;
} }];
];
}; };
# List services that you want to enable: # List services that you want to enable:

View file

@ -10,9 +10,6 @@
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
direnvrcExtra = ''
''${DIRENV_DISABLE:+exit}
'';
}; };
nix.extraOptions = '' nix.extraOptions = ''

View file

@ -58,7 +58,6 @@
ryujinx-greemdev ryujinx-greemdev
protonup-qt protonup-qt
winetricks winetricks
#(pkgs.callPackage ../packages/lucem.nix { inherit pkgs; })
vinegar # Roblox Studio, use Sober in ./flatpak.nix for the Roblox Player vinegar # Roblox Studio, use Sober in ./flatpak.nix for the Roblox Player
celeste64 celeste64
]; ];

View file

@ -52,14 +52,6 @@ in
programs.partition-manager.enable = true; programs.partition-manager.enable = true;
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
programs.ssh = {
enableAskPassword = true;
askPassword = pkgs.lib.mkForce "${pkgs.ksshaskpass.out}/bin/ksshaskpass";
};
environment.variables = {
SSH_ASKPASS_REQUIRE = "prefer";
};
fonts = { fonts = {
enableDefaultPackages = true; enableDefaultPackages = true;
fontDir.enable = true; fontDir.enable = true;

View file

@ -74,10 +74,6 @@ in
# install docker # install docker
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;
autoPrune = {
enable = true;
dates = "daily";
};
}; };
# remove nano # remove nano

View file

@ -1,55 +0,0 @@
{
pkgs,
lib,
...
}:
pkgs.stdenv.mkDerivation rec {
pname = "lucem";
version = "2.1.2";
src = pkgs.fetchFromGitHub {
owner = "xTrayambak";
repo = "lucem";
rev = version;
hash = "sha256-31EdtCQftxhpp2b7fpM5XqRh+r0rBE/k9SpYEPpGpV0=";
};
nativeBuildInputs = with pkgs; [
gtk4.dev
libadwaita.dev
pkg-config
openssl.dev
curl.dev
xorg.libX11
xorg.libXcursor.dev
xorg.libXrender
xorg.libXext
libxkbcommon
libGL.dev
wayland.dev
wayland-protocols
wayland-scanner.dev
nimble
];
buildPhase = ''
runHook preBuild
nimble build
runHook postBuild
'';
installPhase = ''
runHook preInstall
runHook postInstall
'';
meta = {
description = "An open-source bootstrapper for Sober, similar to Bloxstrap.";
homepage = "https://github.com/xTrayambak/lucem";
downloadPage = "https://github.com/xTrayambak/lucem/releases/tag/${version}";
license = lib.licenses.mit; # https://github.com/xTrayambak/lucem/blob/31f996b64edafba1d75e16130bcb14576a326ebd/lucem.nimble#L6
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ cswimr ];
mainProgram = "lucem";
};
}