Compare commits

..

8 Commits

15 changed files with 203 additions and 415 deletions

View File

@ -50,14 +50,6 @@
hostname = "snowhawk"; hostname = "snowhawk";
system = "x86_64-linux"; system = "x86_64-linux";
} }
{
hostname = "sprite";
system = "aarch64-linux";
}
{
hostname = "nixos";
system = "x86_64-linux";
}
]; ];
homeConfigurations = homeConfigurations =

View File

@ -15,8 +15,8 @@ in
{ {
imports = getModules ./.; imports = getModules ./.;
nixpkgs.config.allowUnfree = true; # nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ self.overlays.default ]; # nixpkgs.overlays = [ self.overlays.default ];
snowhawk.user.enable = lib.mkDefault true; snowhawk.user.enable = lib.mkDefault true;
snowhawk.tmux.enable = lib.mkDefault true; snowhawk.tmux.enable = lib.mkDefault true;

View File

@ -19,6 +19,12 @@ in
(writeShellScriptBin "iinact" '' (writeShellScriptBin "iinact" ''
${pkgs.brave}/bin/brave --new-window "http://proxy.iinact.com/overlay/skyline/?OVERLAY_WS=ws://127.0.0.1:10501/ws" ${pkgs.brave}/bin/brave --new-window "http://proxy.iinact.com/overlay/skyline/?OVERLAY_WS=ws://127.0.0.1:10501/ws"
'') '')
# (lib.mkIf cfg.textools.enable pkgs.wrapWine {
# # https://gist.github.com/helpful-fox-senko-san/6238143f5c7352ab44e62c5a0f7f7642
# name = "textools";
# tricks = [ "dotnet48" "dxvk" ];
# })
] ++ map (name: (writeShellScriptBin name launchffxiv)) [ "ff14" "xivlauncher" ]; ] ++ map (name: (writeShellScriptBin name launchffxiv)) [ "ff14" "xivlauncher" ];
}; };
} }

View File

@ -1,135 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ pkgs, inputs, ... }:
{
imports = [
inputs.home-manager.nixosModules.default
../../modules
];
# TODO: fix bootloader
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the XFCE Desktop Environment.
services.xserver.displayManager.lightdm.enable = true;
services.xserver.desktopManager.budgie.enable = true;
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "us";
variant = "";
};
};
# Enable CUPS to print documents.
services.printing.enable = true;
services.envfs.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
programs.nix-ld.enable = true;
# programs.nix-ld.libraries = with pkgs; [
#
# ];
# Define a user account. Don't forget to set a password with `passwd`.
users.users.ravenshade = {
isNormalUser = true;
description = "Zynh Ludwig";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
fish
ripgrep
lazygit
unzip
fzf
tree
xclip
rustup
gnumake
zig
gcc
go
python3
nodejs_22
# dotnet-sdk_8
];
};
# Enable automatic login for the user.
services.displayManager.autoLogin = {
enable = true;
user = "ravenshade";
};
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = { "ravenshade" = import ./home.nix; };
# backupFileExtension = "backup";
};
# programs.hyprland.enable = true;
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [
neovim
curl
git
killall
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -1,31 +0,0 @@
# Do not modify this file! It was generated by 'nixos-generate-config'
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ lib, ... }:
{
imports = [ ];
boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/439bb7c9-9b00-4899-944b-d0606f4c90db";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
virtualisation.virtualbox.guest.enable = true;
}

View File

@ -1,30 +0,0 @@
{ pkgs, inputs, ... }:
{
imports = [
../../home/modules
];
snowhawk.neovim = {
enable = true;
package = inputs.neovim-overlay.packages.${pkgs.system}.default;
};
snowhawk.alacritty.enable = true;
snowhawk.theme.enable = true;
snowhawk.projects.enable = true;
xsession.numlock.enable = true;
home.packages = with pkgs; [
nix-output-monitor
(writeShellScriptBin "rebuild" ''
sudo nixos-rebuild switch --log-format internal-json -v |& nom --json
'')
];
home.file = { };
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.stateVersion = "23.11";
}

View File

@ -1,137 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ pkgs, inputs, ... }:
{
imports = [
inputs.home-manager.nixosModules.default
../../modules
];
# TODO: fix bootloader
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the XFCE Desktop Environment.
services.xserver.displayManager.lightdm.enable = true;
services.xserver.desktopManager.budgie.enable = true;
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "us";
variant = "";
};
};
# Enable CUPS to print documents.
services.printing.enable = true;
services.envfs.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
programs.nix-ld.enable = true;
# programs.nix-ld.libraries = with pkgs; [
#
# ];
# Define a user account. Don't forget to set a password with `passwd`.
users.users.ravenshade = {
isNormalUser = true;
description = "Zynh Ludwig";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
fish
ripgrep
lazygit
unzip
fzf
tree
nix-output-monitor
xclip
rustup
gnumake
zig
gcc
go
python3
nodejs_22
# dotnet-sdk_8
];
};
# Enable automatic login for the user.
services.displayManager.autoLogin = {
enable = true;
user = "ravenshade";
};
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = { "ravenshade" = import ./home.nix; };
# backupFileExtension = "backup";
};
# programs.hyprland.enable = true;
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [
neovim
curl
git
killall
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -1,34 +0,0 @@
{ lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" "usb_storage" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/fa4ed906-f26b-40ec-859c-81813151c33a";
fsType = "ext4";
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/31B8-8850";
fsType = "vfat";
};
swapDevices = [ ];
networking.hostName = "sprite";
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View File

@ -1,27 +0,0 @@
{ pkgs, inputs, ... }:
{
imports = [
../../home/modules
];
snowhawk.neovim = {
enable = true;
package = inputs.neovim-overlay.packages.${pkgs.system}.default;
};
snowhawk.alacritty.enable = true;
snowhawk.theme.enable = true;
snowhawk.projects.enable = true;
xsession.numlock.enable = true;
home.packages = with pkgs; [
(writeShellScriptBin "rebuild" ''
sudo nixos-rebuild switch --log-format internal-json -v |& nom --json
'')
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.stateVersion = "23.11";
}

View File

@ -1,10 +1,17 @@
{ nixpkgs, self, ... }@inputs: { nixpkgs, self, ... }@inputs:
let let
lib = nixpkgs.lib.extend (import ../lib); makePkgs = system: (import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ self.overlays.default ];
});
lib = nixpkgs.lib;
inherit (inputs.home-manager.lib) homeManagerConfiguration; inherit (inputs.home-manager.lib) homeManagerConfiguration;
inherit (nixpkgs.lib) nixosSystem; inherit (lib) nixosSystem;
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.attrsets) nameValuePair; inherit (lib.attrsets) nameValuePair;
in in
@ -14,8 +21,9 @@ rec {
nameValuePair nameValuePair
hostname hostname
(nixosSystem { (nixosSystem {
inherit system; pkgs = makePkgs system;
specialArgs = { inherit inputs lib self; }; specialArgs = { inherit inputs self; };
modules = [ modules = [
../hosts/${hostname}/hardware-configuration.nix ../hosts/${hostname}/hardware-configuration.nix
../hosts/${hostname}/configuration.nix ../hosts/${hostname}/configuration.nix
@ -39,11 +47,8 @@ rec {
nameValuePair nameValuePair
"${user}${hostStr}" "${user}${hostStr}"
(homeManagerConfiguration { (homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = makePkgs system;
extraSpecialArgs = { extraSpecialArgs = { inherit inputs self; };
inherit inputs self;
lib = lib.extend (_: _: inputs.home-manager.lib);
};
modules = [ modules = [
../hosts/${configHost}/home.nix ../hosts/${configHost}/home.nix

View File

@ -1,5 +1,7 @@
final: prev: final: prev:
with prev; let
inherit (final) isFunction;
in
rec { rec {
# Ternary operator # Ternary operator
# Exaample: # Exaample:

View File

@ -14,5 +14,5 @@ in
snowhawk.audio.enable = lib.mkDefault true; snowhawk.audio.enable = lib.mkDefault true;
snowhawk.env.enable = lib.mkDefault true; snowhawk.env.enable = lib.mkDefault true;
snowhawk.sops.enable = lib.mkDefault true; snowhawk.sops.enable = lib.mkDefault true;
snowhawk.nixpkgs.enable = lib.mkDefault true; snowhawk.nixpkgs.enable = lib.mkDefault false;
} }

View File

@ -0,0 +1,91 @@
#!/usr/bin/env bash
set -eu
function die {
supress_generic_error=1
if [ -v bin_ZENITY ] && [ ! -z "$bin_ZENITY" ]; then
"$bin_ZENITY" --error --text="$*"
else
echo "error: $*" 2>&2
fi
}
function absolute_binary {
bin="$(command -v "$@" 2>&-)"
if [ -z "$bin" ]; then
die "No such commands: $@"
fi
echo $bin | head -n 1
}
function cleanup {
if [ $? != 0 ] && [ ! -v supress_generic_error ]; then
die "Errors happened during runtime. See this script logs for details."
fi
}
trap cleanup EXIT
CHROME_BINARIES=(chromium)
if [ ! -v bin_ZENITY ]; then
bin_ZENITY="$(absolute_binary zenity)"
fi
if [ ! -v bin_CHROMIUM ]; then
bin_CHROMIUM="$(absolute_binary chromium)"
fi
if [ ! -v text_QUERY ]; then
text_QUERY="Link to be opened"
fi
if [ ! -v text_NOURL ]; then
text_NOURL="No URL specified"
fi
if [ $# -eq 0 ]; then
URL="$("$bin_ZENITY" --entry --text="$text_QUERY" || true)"
else
URL="$@"
fi
if [ -z "$URL" ]; then
die $text_NOURL
fi
if [[ "$URL" =~ ^~ ]]; then
URL=$(echo $URL | sed -E s:^~\/?::)
URL="file://$HOME/$URL"
fi
if [[ "$URL" =~ ^\/ ]]; then
URL="file://$URL"
fi
if [[ ! "$URL" =~ ^(file|https?)?:\/\/ ]]; then
URL="https://$URL"
fi
echo final url: $URL
chromeFlags=()
if [ ! -v CHROME_DONT_BORDERLESS ]; then
chromeFlags+=(--app="$URL")
else
chromeFlags+=("$URL")
fi
if [ ! -v profileToplevel ]; then
profileToplevel=~/.config/borderless-browser-profiles
fi
if [ -v CHROME_PROFILE ] && [[ "$CHROME_PROFILE" =~ ^[a-zA-Z_0-9-]*$ ]]; then
profileDir=$profileToplevel/$CHROME_PROFILE
chromeFlags+=(--user-data-dir="$profileDir")
fi
echo "${chromeFlags[@]}"
"$bin_CHROMIUM" "${chromeFlags[@]}"

View File

@ -0,0 +1,83 @@
{ lib
, stdenvNoCC
, chromium
, gnome3
, zenity ? gnome3.zenity
, makeDesktopItem
, copyDesktopItems
, makeWrapper
}:
let
mkWebapp =
{ name ? "webapp"
, desktopName ? "Web Application"
, browser ? lib.getExe chromium
, icon ? "applications-internet"
, url ? null
, queryText ? "Link to be opened"
, noURLSpecifiedText ? "No URL specified"
, profile ? null
, passthru ? { }
}:
let
makeWrapperArgs = [
"--set-default"
"text_QUERY"
queryText
"--set-default"
"text_NOURL"
noURLSpecifiedText
"--set"
"bin_CHROMIUM"
browser
"--set"
"bin_ZENITY"
(lib.getExe zenity)
]
++ (lib.optionals (profile != null) [ "--set" "CHROME_PROFILE" profile ])
++ (lib.optionals (url != null) [ "--add-flags" url ])
;
in
stdenvNoCC.mkDerivation (attrs: {
name = "webapp-${name}";
dontUnpack = true;
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
makeWrapper ${./borderlessBrowser} $out/bin/$name ${lib.escapeShellArgs makeWrapperArgs}
runHook postInstall
'';
postFixup = ''
substituteInPlace $out/share/applications/$name.desktop --replace @bin@ $out/bin/$name
'';
desktopItems = [
(makeDesktopItem {
inherit (attrs) name;
inherit desktopName icon;
type = "Application";
exec = "@bin@";
})
];
passthru = passthru // { inherit makeWrapperArgs; };
});
in
mkWebapp {
passthru = {
wrap = mkWebapp;
};
}

View File

@ -3,6 +3,9 @@ let
callDefaultPackage = path: prev.callPackage path { }; callDefaultPackage = path: prev.callPackage path { };
in in
{ {
lib = prev.lib.extend import ../lib;
wrapWine = callDefaultPackage ./wrapWine; wrapWine = callDefaultPackage ./wrapWine;
writeXrandrScriptBin = callDefaultPackage ./writeXrandrScriptBin; writeXrandrScriptBin = callDefaultPackage ./writeXrandrScriptBin;
borderlessBrowser = callDefaultPackage ./writeXrandrScriptBin;
} }