Compare commits

...

3 Commits

95 changed files with 1040 additions and 832 deletions

View File

@ -2,3 +2,5 @@
97f6bb71e0774a96f74cbabc14933b2d8cd709c3
# Fixed a bunch of packages that forced a reformat
daa64b85dcc6d98fcb453d7201726ff0b7b3b3b5
# Reformat with nixfmt-rfc-style
c4a302db8c596e187755c204b6007cc328563baa

View File

@ -1,16 +1,9 @@
let
inherit
(builtins)
currentSystem
fromJSON
readFile
;
inherit (builtins) currentSystem fromJSON readFile;
# Copied from https://github.com/edolstra/flake-compat/pull/44/files
fetchurl = {
url,
sha256,
}:
fetchurl =
{ url, sha256 }:
derivation {
builder = "builtin:fetchurl";
@ -44,16 +37,16 @@ let
urls = [ url ];
};
getFlake = name:
with (fromJSON (readFile ./flake.lock)).nodes.${name}.locked; {
getFlake =
name: with (fromJSON (readFile ./flake.lock)).nodes.${name}.locked; {
inherit rev;
outPath = fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
sha256 = narHash;
};
};
getRawFlake = name:
with (fromJSON (readFile ./flake.lock)).nodes.${name}.locked; {
getRawFlake =
name: with (fromJSON (readFile ./flake.lock)).nodes.${name}.locked; {
inherit rev;
outPath = fetchurl {
inherit url;
@ -63,12 +56,18 @@ let
in
{
system ? currentSystem,
pkgs ? import (getFlake "nixpkgs") {localSystem = {inherit system;};},
pkgs ? import (getFlake "nixpkgs") {
localSystem = {
inherit system;
};
},
fenix ? getFlake "fenix",
rust-manifest ? getRawFlake "rust-manifest",
}: let
}:
let
callPackage = pkg: pkgs.callPackage pkg;
in {
in
{
adb-sync = callPackage ./packages/adb-sync { };
adbtuifm = callPackage ./packages/adbtuifm { };
adx = callPackage ./packages/adx { };
@ -76,7 +75,9 @@ in
diffuse-bin = callPackage ./packages/diffuse-bin { };
gdrive = callPackage ./packages/gdrive { };
gitice = callPackage ./packages/gitice {
inputs = {inherit fenix rust-manifest;};
inputs = {
inherit fenix rust-manifest;
};
};
gitout = callPackage ./packages/gitout { };
gphotos-cdp = callPackage ./packages/gphotos-cdp { };
@ -84,7 +85,9 @@ in
healthchecks-monitor = callPackage ./packages/healthchecks-monitor { };
katbin = callPackage ./packages/katbin { };
linkleaner = callPackage ./packages/linkleaner {
inputs = {inherit fenix rust-manifest;};
inputs = {
inherit fenix rust-manifest;
};
};
monocraft-nerdfonts = callPackage ./packages/monocraft-nerdfonts { };
patreon-dl = callPackage ./packages/patreon-dl { };

View File

@ -1,5 +1,7 @@
{
outputs = inputs: let
outputs =
inputs:
let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;
@ -35,9 +37,7 @@
nixos-hardware.nixosModules.raspberry-pi-4
srvos.nixosModules.server
];
systems.hosts.ryzenbox.modules = with inputs; [
srvos.nixosModules.desktop
];
systems.hosts.ryzenbox.modules = with inputs; [ srvos.nixosModules.desktop ];
systems.hosts.wailord.modules = with inputs; [
attic.nixosModules.atticd
disko.nixosModules.disko
@ -62,7 +62,7 @@
formatter = channels.nixpkgs.writeShellApplication {
name = "format";
runtimeInputs = with channels.nixpkgs; [
alejandra
nixfmt-rfc-style
deadnix
shfmt
statix
@ -72,7 +72,7 @@
shfmt --write --simplify --language-dialect bash --indent 2 --case-indent --space-redirects .;
deadnix --edit
statix check . || statix fix .
alejandra --quiet .
nixfmt .
'';
};
};

View File

@ -1,13 +1,13 @@
{
lib,
inputs,
}: let
{ lib, inputs }:
let
inherit (inputs) deploy-rs;
in {
mkDeploy = {self}: let
in
{
mkDeploy =
{ self }:
let
hosts = self.nixosConfigurations or { };
nodes =
builtins.mapAttrs (_: machine: {
nodes = builtins.mapAttrs (_: machine: {
hostname = machine.config.networking.hostName;
fastConnection = true;
remoteBuild = false;
@ -18,7 +18,9 @@ in {
sshUser = "root";
path = deploy-rs.lib.${machine.pkgs.system}.activate.nixos machine;
};
})
hosts;
in {inherit nodes;};
}) hosts;
in
{
inherit nodes;
};
}

View File

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
fonts = {
fontDir.enable = true;
fonts = [ pkgs.nerdfonts ];

View File

@ -7,10 +7,7 @@
"gnu-sed"
"ruby"
];
casks = [
"flutter"
];
taps = [
];
casks = [ "flutter" ];
taps = [ ];
};
}

View File

@ -4,7 +4,8 @@
config,
inputs,
...
}: {
}:
{
nix = {
gc = {
automatic = true;
@ -41,7 +42,10 @@
log-lines = 20;
max-jobs = "auto";
sandbox = true;
trusted-users = ["root" "msfjarvis"];
trusted-users = [
"root"
"msfjarvis"
];
warn-dirty = false;
trusted-substituters = [

View File

@ -1,19 +1,17 @@
{ config, pkgs, ... }:
let
initScript = if pkgs.stdenv.isDarwin then "darwin-init" else "shell-init";
in
{
config,
pkgs,
...
}: let
initScript =
if pkgs.stdenv.isDarwin
then "darwin-init"
else "shell-init";
in {
programs.bash = {
enable = true;
historySize = 1000;
historyFile = "${config.home.homeDirectory}/.bash_history";
historyFileSize = 10000;
historyControl = ["ignorespace" "erasedups"];
historyControl = [
"ignorespace"
"erasedups"
];
shellOptions = [
# Append to history file rather than replacing it.
"histappend"

View File

@ -1,6 +1,9 @@
{lib, ...}: {
{ lib, ... }:
{
programs.bat = {
enable = true;
config = {theme = lib.mkDefault "zenburn";};
config = {
theme = lib.mkDefault "zenburn";
};
};
}

View File

@ -1,3 +1,5 @@
{
programs.bottom = {enable = true;};
programs.bottom = {
enable = true;
};
}

View File

@ -1,3 +1 @@
{
fonts.fontconfig.enable = true;
}
{ fonts.fontconfig.enable = true; }

View File

@ -6,6 +6,9 @@
enableBashIntegration = true;
fileWidgetCommand = "fd -H";
changeDirWidgetCommand = "fd -Htd";
historyWidgetOptions = ["--sort" "--exact"];
historyWidgetOptions = [
"--sort"
"--exact"
];
};
}

View File

@ -6,7 +6,9 @@
git_protocol = "https";
editor = "micro";
prompt = "enabled";
aliases = {co = "pr checkout";};
aliases = {
co = "pr checkout";
};
};
};
}

View File

@ -3,9 +3,11 @@
lib,
host,
...
}: let
}:
let
isWorkMachine = host == "Harshs-MacBook-Pro";
in {
in
{
programs.git = {
enable = true;
ignores = [
@ -18,9 +20,7 @@ in {
".DS_Store"
];
includes =
[
{path = "${config.home.homeDirectory}/git-repos/dotfiles/.gitconfig";}
]
[ { path = "${config.home.homeDirectory}/git-repos/dotfiles/.gitconfig"; } ]
++ lib.optionals isWorkMachine [
{ path = "${config.home.homeDirectory}/git-repos/dotfiles/.gitconfig-work"; }
];

View File

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
services.gpg-agent = {
enable = !pkgs.stdenv.isDarwin;
defaultCacheTtl = 3600;

View File

@ -1,3 +1,5 @@
{
programs.gpg = {enable = true;};
programs.gpg = {
enable = true;
};
}

View File

@ -1,3 +1,5 @@
{
programs.home-manager = {enable = true;};
programs.home-manager = {
enable = true;
};
}

View File

@ -1,3 +1,5 @@
{
programs.jq = {enable = true;};
programs.jq = {
enable = true;
};
}

View File

@ -3,9 +3,11 @@
pkgs,
lib,
...
}: let
}:
let
cfg = config.profiles.logseq;
in {
in
{
options.profiles.logseq = with lib; {
enable = mkEnableOption "Install logseq and configure git synchronization";
};

View File

@ -1,4 +1,5 @@
{inputs, ...}: {
{ inputs, ... }:
{
programs.micro = {
enable = true;
settings = {

View File

@ -3,9 +3,11 @@
pkgs,
lib,
...
}: let
}:
let
cfg = config.profiles.mpv;
in {
in
{
options.profiles.mpv = with lib; {
enable = mkEnableOption "Enable MPV player";
};
@ -13,7 +15,8 @@ in {
programs.mpv = {
enable = true;
package =
pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
pkgs.wrapMpv
(pkgs.mpv-unwrapped.override {
waylandSupport = true;
x11Support = false;
cddaSupport = false;
@ -45,7 +48,8 @@ in {
xineramaSupport = false;
xvSupport = false;
zimgSupport = false;
}) {
})
{
scripts = with pkgs.mpvScripts; [
uosc
thumbfast

View File

@ -1,6 +1,7 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
home.packages = with pkgs; [
alejandra
nixfmt-rfc-style
aria2
byobu
cachix

View File

@ -3,9 +3,11 @@
pkgs,
lib,
...
}: let
}:
let
cfg = config.profiles.pass;
in {
in
{
options.profiles.pass = with lib; {
enable = mkEnableOption "Enable password-store and related stuff";
};
@ -21,8 +23,14 @@ in {
x11Support = false;
waylandSupport = true;
dmenuSupport = false;
})
.withExtensions (exts: with exts; [pass-genphrase pass-otp pass-update]);
}).withExtensions
(
exts: with exts; [
pass-genphrase
pass-otp
pass-update
]
);
};
services.git-sync = {
enable = true;

View File

@ -4,10 +4,12 @@
system,
inputs,
...
}: let
}:
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${system};
cfg = config.profiles.spotify;
in {
in
{
options.profiles.spotify = with lib; {
enable = mkEnableOption "Enable Spotify";
};
@ -16,9 +18,7 @@ in {
enable = true;
theme = spicePkgs.themes.dracula;
enabledCustomApps = with spicePkgs.apps; [
lyrics-plus
];
enabledCustomApps = with spicePkgs.apps; [ lyrics-plus ];
enabledExtensions = with spicePkgs.extensions; [
fullAppDisplay

View File

@ -1,10 +1,8 @@
{
config,
lib,
...
}: let
{ config, lib, ... }:
let
cfg = config.profiles.starship;
in {
in
{
options.profiles.starship = with lib; {
server = mkEnableOption "Customize starship for servers";
};
@ -13,10 +11,7 @@ in {
enable = true;
enableBashIntegration = true;
settings = {
format =
if cfg.server
then "$directory$git_branch$git_state$git_status "
else "$all";
format = if cfg.server then "$directory$git_branch$git_state$git_status " else "$all";
add_newline = false;
aws.disabled = true;
azure.disabled = true;

View File

@ -3,9 +3,11 @@
pkgs,
lib,
...
}: let
}:
let
cfg = config.profiles.vscode;
in {
in
{
options.profiles.vscode = with lib; {
enable = mkEnableOption "Enable VSCode editor";
};
@ -15,9 +17,8 @@ in {
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
mutableExtensionsDir = false;
extensions =
lib.mkDefault
((lib.optionals pkgs.stdenv.isLinux [pkgs.vscode-extensions.rust-lang.rust-analyzer-nightly])
extensions = lib.mkDefault (
(lib.optionals pkgs.stdenv.isLinux [ pkgs.vscode-extensions.rust-lang.rust-analyzer-nightly ])
++ (with pkgs.vscode-marketplace; [
arrterian.nix-env-selector
eamodio.gitlens
@ -31,7 +32,8 @@ in {
mtdmali.daybreak-theme
oderwat.indent-rainbow
tamasfe.even-better-toml
]));
])
);
userSettings = {
"files.exclude" = {
"**/.classpath" = true;
@ -67,10 +69,8 @@ in {
"[json]"."editor.defaultFormatter" = "vscode.json-language-features";
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${lib.getExe pkgs.nil}";
"nix.formatterPath" = "${lib.getExe pkgs.alejandra}";
"nix.serverSettings".nil.formatting.command = [
"${lib.getExe pkgs.alejandra}"
];
"nix.formatterPath" = "${lib.getExe pkgs.nixfmt-rfc-style}";
"nix.serverSettings".nil.formatting.command = [ "${lib.getExe pkgs.nixfmt-rfc-style}" ];
"gitlens.currentLine.enabled" = false;
"gitlens.statusBar.reduceFlicker" = false;
"gitlens.advanced.fileHistoryFollowsRenames" = true;

View File

@ -3,9 +3,11 @@
lib,
pkgs,
...
}: let
}:
let
cfg = config.profiles.wezterm;
in {
in
{
options.profiles.wezterm = with lib; {
enable = mkEnableOption "Enable wezterm, a GPU-accelerated terminal emulator";
};

View File

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
xdg = {
enable = true;
mime.enable = !pkgs.stdenv.isDarwin;

View File

@ -4,13 +4,13 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.gitout;
in {
in
{
options.services.gitout = {
enable = mkEnableOption {
description = mdDoc "Whether to enable the gitout backup service.";
};
enable = mkEnableOption { description = mdDoc "Whether to enable the gitout backup service."; };
config-file = mkOption {
type = types.path;
@ -40,8 +40,14 @@ in {
config = mkIf cfg.enable {
systemd.services.gitout = {
wantedBy = [ "default.target" ];
after = ["fs.service" "networking.target"];
wants = ["fs.service" "networking.target"];
after = [
"fs.service"
"networking.target"
];
wants = [
"fs.service"
"networking.target"
];
serviceConfig = {
User = cfg.user;
@ -72,7 +78,10 @@ in {
};
};
users.groups =
mkIf (cfg.group == "gitout") {gitout = {gid = null;};};
users.groups = mkIf (cfg.group == "gitout") {
gitout = {
gid = null;
};
};
};
}

View File

@ -4,9 +4,11 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.gphotos-cdp;
in {
in
{
options.services.gphotos-cdp = {
enable = mkEnableOption {
description = mdDoc "Whether to enable the gphotos-cdp backup service.";
@ -40,8 +42,14 @@ in {
config = mkIf cfg.enable {
systemd.services.gphotos-cdp = {
wantedBy = [ "default.target" ];
after = ["fs.service" "networking.target"];
wants = ["fs.service" "networking.target"];
after = [
"fs.service"
"networking.target"
];
wants = [
"fs.service"
"networking.target"
];
serviceConfig = {
User = cfg.user;
@ -49,7 +57,12 @@ in {
Restart = "on-failure";
RestartSec = "30s";
Type = "oneshot";
Environment = "PATH=${makeBinPath [pkgs.coreutils pkgs.google-chrome]}";
Environment = "PATH=${
makeBinPath [
pkgs.coreutils
pkgs.google-chrome
]
}";
};
script = ''
exec env ${getExe cfg.package} -v -dev -headless -dldir ${cfg.dldir} -session-dir ${cfg.session-dir}
@ -73,7 +86,10 @@ in {
};
};
users.groups =
mkIf (cfg.group == "gphotos-cdp") {gphotos-cdp = {gid = null;};};
users.groups = mkIf (cfg.group == "gphotos-cdp") {
gphotos-cdp = {
gid = null;
};
};
};
}

View File

@ -1,7 +1,9 @@
{
i18n = let
i18n =
let
locale = "en_US.UTF-8";
in {
in
{
defaultLocale = locale;
extraLocaleSettings = {
LC_ADDRESS = locale;

View File

@ -4,7 +4,8 @@
config,
inputs,
...
}: {
}:
{
documentation = {
enable = true;
doc.enable = false;
@ -59,7 +60,10 @@
cores = 6;
max-jobs = 12;
sandbox = true;
trusted-users = ["root" "@wheel"];
trusted-users = [
"root"
"@wheel"
];
use-cgroups = true;
warn-dirty = false;

View File

@ -4,13 +4,13 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.piv-agent;
in {
in
{
options.services.piv-agent = {
enable = mkEnableOption {
description = mdDoc "Whether to configure the piv-agent service";
};
enable = mkEnableOption { description = mdDoc "Whether to configure the piv-agent service"; };
package = mkPackageOptionMD pkgs.jarvis "piv-agent" { };
};
@ -38,12 +38,16 @@ in {
RestrictSUIDSGID = true;
LockPersonality = true;
CapabilityBoundingSet = [ "" ];
SystemCallFilter = ["@system-service" "~@privileged" "@resources"];
SystemCallFilter = [
"@system-service"
"~@privileged"
"@resources"
];
SystemCallErrorNumber = "EPERM";
SystemCallArchitectures = "native";
NoNewPrivileges = true;
KeyringMode = "private";
UMask = 0177;
UMask = 177;
RuntimeDirectory = "piv-agent";
};
};

View File

@ -3,11 +3,16 @@
lib,
pkgs,
...
}: let
}:
let
cfg = config.profiles.desktop;
defaultJdk = pkgs.openjdk22;
toolchains = [pkgs.openjdk17 defaultJdk];
in {
toolchains = [
pkgs.openjdk17
defaultJdk
];
in
{
options.profiles.desktop.android-dev = with lib; {
enable = mkEnableOption "Configure a development environment for Android apps";
};
@ -32,8 +37,7 @@ in {
snowfallorg.users.msfjarvis.home.config = {
programs.gradle = {
enable = true;
package = pkgs.callPackage (pkgs.gradleGen
{
package = pkgs.callPackage (pkgs.gradleGen {
version = "8.8-rc-1";
nativeVersion = "0.22-milestone-26";
hash = "sha256-ouHP7n/97uhgFbhbLdKkNQMsQO7cAdgXIoVVbH2P6hM=";
@ -46,7 +50,9 @@ in {
"org.gradle.home" = defaultJdk;
"org.gradle.java.installations.auto-detect" = false;
"org.gradle.java.installations.auto-download" = false;
"org.gradle.java.installations.paths" = lib.concatMapStringsSep "," (x: "${x}/lib/openjdk") toolchains;
"org.gradle.java.installations.paths" = lib.concatMapStringsSep "," (
x: "${x}/lib/openjdk"
) toolchains;
};
};
};

View File

@ -3,9 +3,11 @@
lib,
pkgs,
...
}: let
}:
let
cfg = config.profiles.desktop;
in {
in
{
options.profiles.desktop.cinnamon = with lib; {
enable = mkEnableOption "Setup desktop with Cinnamon DE";
};
@ -20,8 +22,10 @@ in {
};
};
programs.geary.enable = false;
environment.cinnamon.excludePackages = with pkgs;
with pkgs.cinnamon; [
environment.cinnamon.excludePackages =
with pkgs;
with pkgs.cinnamon;
[
sound-theme-freedesktop
nixos-artwork.wallpapers.simple-dark-gray
mint-artwork

View File

@ -4,10 +4,17 @@
pkgs,
inputs,
...
}: let
}:
let
cfg = config.profiles.desktop;
in {
imports = [./android-dev.nix ./cinnamon.nix ./gnome3.nix ./noise-cancelation.nix];
in
{
imports = [
./android-dev.nix
./cinnamon.nix
./gnome3.nix
./noise-cancelation.nix
];
options.profiles.desktop = with lib; {
enable = mkEnableOption "Profile for desktop machines (i.e. not servers)";
};
@ -47,7 +54,9 @@ in {
printing.enable = lib.mkDefault true;
};
hardware = {bluetooth.enable = lib.mkDefault true;};
hardware = {
bluetooth.enable = lib.mkDefault true;
};
# Theming
stylix = {

View File

@ -3,9 +3,11 @@
lib,
pkgs,
...
}: let
}:
let
cfg = config.profiles.desktop;
in {
in
{
options.profiles.desktop.gnome3 = with lib; {
enable = mkEnableOption "Setup desktop with Gnome DE";
};
@ -24,7 +26,8 @@ in {
# Required by the tophat extension
services.xserver.desktopManager.gnome.sessionPath = with pkgs; [ libgtop ];
users.users.msfjarvis.packages = with pkgs;
users.users.msfjarvis.packages =
with pkgs;
[
# Old GNOME picture viewer, better than the current default
gnome.eog
@ -102,10 +105,7 @@ in {
};
"org/gnome/desktop/interface" = with config.stylix.fonts; {
# Taken from Stylix
color-scheme =
if config.stylix.polarity == "dark"
then "prefer-dark"
else "default";
color-scheme = if config.stylix.polarity == "dark" then "prefer-dark" else "default";
font-name = "${sansSerif.name} ${toString sizes.applications}";
document-font-name = "${serif.name} ${toString (sizes.applications - 1)}";
monospace-font-name = "${monospace.name} ${toString sizes.terminal}";

View File

@ -3,7 +3,8 @@
lib,
pkgs,
...
}: let
}:
let
cfg = config.profiles.desktop;
noise-suppression-for-voice = pkgs.writeTextDir "share/pipewire/pipewire.conf.d/99-noise-cancellation.conf" ''
context.modules = [
@ -38,7 +39,8 @@
}
]
'';
in {
in
{
options.profiles.desktop.noise-cancelation = with lib; {
enable = mkEnableOption "Enable noise cancelation in PipeWire";
};

View File

@ -1,10 +1,8 @@
{
config,
lib,
...
}: let
{ config, lib, ... }:
let
cfg = config.profiles.server;
in {
in
{
options.profiles.server = with lib; {
enable = mkEnableOption "server profile";
tailscaleExitNode = mkEnableOption "Run this machine as a Tailscale exit node";
@ -48,15 +46,19 @@ in {
services.tailscale-autoconnect = {
enable = true;
authkeyFile = "/run/secrets/tsauthkey";
extraOptions = ["--accept-risk=lose-ssh" "--ssh"] ++ lib.optionals cfg.tailscaleExitNode ["--advertise-exit-node"];
extraOptions = [
"--accept-risk=lose-ssh"
"--ssh"
] ++ lib.optionals cfg.tailscaleExitNode [ "--advertise-exit-node" ];
};
boot.kernel.sysctl =
if cfg.tailscaleExitNode
then {
if cfg.tailscaleExitNode then
{
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
}
else {};
else
{ };
};
}

View File

@ -4,11 +4,13 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.qbittorrent;
configDir = "${cfg.dataDir}/.config";
openFilesLimit = 4096;
in {
in
{
options.services.qbittorrent = {
enable = mkOption {
type = types.bool;
@ -105,7 +107,10 @@ in {
};
};
users.groups =
mkIf (cfg.group == "qbittorrent") {qbittorrent = {gid = null;};};
users.groups = mkIf (cfg.group == "qbittorrent") {
qbittorrent = {
gid = null;
};
};
};
}

View File

@ -4,15 +4,17 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.rucksack;
settingsFormat = pkgs.formats.toml { };
settingsFile = settingsFormat.generate "rucksack.toml" {inherit (cfg) sources target file_filter;};
in {
options.services.rucksack = {
enable = mkEnableOption {
description = mdDoc "Whether to enable the rucksack daemon.";
settingsFile = settingsFormat.generate "rucksack.toml" {
inherit (cfg) sources target file_filter;
};
in
{
options.services.rucksack = {
enable = mkEnableOption { description = mdDoc "Whether to enable the rucksack daemon."; };
sources = mkOption {
type = types.listOf types.str;
@ -76,7 +78,10 @@ in {
};
};
users.groups =
mkIf (cfg.group == "rucksack") {rucksack = {gid = null;};};
users.groups = mkIf (cfg.group == "rucksack") {
rucksack = {
gid = null;
};
};
};
}

View File

@ -1,4 +1,5 @@
{lib, ...}: {
{ lib, ... }:
{
stylix.autoEnable = lib.mkDefault false;
stylix.image = lib.mkDefault ./wall.png;
stylix.base16Scheme = lib.mkDefault ./dracula.yml;

View File

@ -4,9 +4,11 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.tailscale-autoconnect;
in {
in
{
options.services.tailscale-autoconnect = {
enable = mkEnableOption {
description = mdDoc "Whether to configure the Tailscale autoconnect service";
@ -30,8 +32,14 @@ in {
description = "Automatic connection to Tailscale";
# make sure tailscale is running before trying to connect to tailscale
after = ["network-pre.target" "tailscale.service"];
wants = ["network-pre.target" "tailscale.service"];
after = [
"network-pre.target"
"tailscale.service"
];
wants = [
"network-pre.target"
"tailscale.service"
];
wantedBy = [ "multi-user.target" ];
# set this service as a oneshot job

View File

@ -1,16 +1,18 @@
{
config,
lib,
...
}: let
{ config, lib, ... }:
let
cfg = config.profiles.tailscale;
in {
in
{
options.profiles.tailscale = with lib; {
enable = mkEnableOption "Tailscale profile";
};
config = lib.mkIf cfg.enable {
networking = {
nameservers = ["100.100.100.100" "8.8.8.8" "1.1.1.1"];
nameservers = [
"100.100.100.100"
"8.8.8.8"
"1.1.1.1"
];
search = [ "tiger-shark.ts.net" ];
};

View File

@ -1,4 +1,5 @@
{inputs, ...}: _final: prev: {
{ inputs, ... }:
_final: prev: {
attic = inputs.attic.packages.${prev.system}.attic-client;
# Force the use of the JDK we're using everywhere else
jdk = prev.openjdk22;
@ -18,9 +19,7 @@
patches = [ ./megatools.patch ];
});
# Set default fonts
nerdfonts = prev.nerdfonts.override {
fonts = ["JetBrainsMono"];
};
nerdfonts = prev.nerdfonts.override { fonts = [ "JetBrainsMono" ]; };
nix = prev.nixVersions.git;
qbittorrent = prev.qbittorrent.override { guiSupport = false; };
}

View File

@ -16,7 +16,10 @@ buildGoModule rec {
vendorHash = "sha256-voVoowjM90OGWXF4REEevO8XEzT7azRYiDay4bnGBks=";
ldflags = ["-s" "-w"];
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "A TUI File Manager for ADB";

View File

@ -29,7 +29,10 @@ rustPlatform.buildRustPackage rec {
meta = with lib; {
description = "Rust tooling to poll Google Maven repository for updates to AndroidX artifacts";
homepage = "https://github.com/msfjarvis/adx";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "adx";
};

View File

@ -42,7 +42,16 @@ rustPlatform.buildRustPackage rec {
wrapGAppsHook
];
buildInputs = [atk cairo gdk-pixbuf gtk3 gtksourceview3 harfbuzz pango zlib];
buildInputs = [
atk
cairo
gdk-pixbuf
gtk3
gtksourceview3
harfbuzz
pango
zlib
];
doCheck = false;
@ -64,8 +73,7 @@ rustPlatform.buildRustPackage rec {
];
terminal = false;
type = "Application";
mimeTypes = [
];
mimeTypes = [ ];
})
];

View File

@ -2,14 +2,18 @@
rust,
stdenv,
fetchurl,
}: let
}:
let
arch = rust.toRustTarget stdenv.hostPlatform;
fetch_librusty_v8 = args:
fetch_librusty_v8 =
args:
fetchurl {
name = "librusty_v8-${args.version}";
url = "https://github.com/denoland/rusty_v8/releases/download/v${args.version}/librusty_v8_release_${arch}.a.gz";
sha256 = args.shas.${stdenv.hostPlatform.system};
meta = {inherit (args) version;};
meta = {
inherit (args) version;
};
};
in
fetch_librusty_v8 {

View File

@ -23,17 +23,16 @@ rustPlatform.buildRustPackage rec {
useNextest = true;
buildInputs =
lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.AppKit
]
++ lib.optionals stdenv.isLinux [
xorg.libxcb
];
lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AppKit ]
++ lib.optionals stdenv.isLinux [ xorg.libxcb ];
meta = with lib; {
description = "CLI to listen to clipboard events and perform operations on the copied text";
homepage = "https://github.com/msfjarvis/clipboard-substitutor";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "clipboard-substitutor";
};

View File

@ -16,7 +16,10 @@ buildGoModule rec {
vendorHash = "sha256-WibiLYMeWR63Q8lu287jeczT0n0/lh6T8PfOH7eJh8Q=";
ldflags = ["-s" "-w"];
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "Google Drive CLI Client";

View File

@ -4,7 +4,8 @@
makeRustPlatform,
lib,
inputs,
}: let
}:
let
inherit (inputs) fenix rust-manifest;
inherit ((import fenix { inherit pkgs; })) fromManifestFile;
@ -13,8 +14,8 @@ in
(makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
})
.buildRustPackage rec {
}).buildRustPackage
rec {
pname = "gitice";
version = "2.0.4";
@ -32,7 +33,10 @@ in
meta = with lib; {
description = "Snapshot your local git repositories for easy restoration";
homepage = "https://github.com/msfjarvis/gitice";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "gitice";
};

View File

@ -30,15 +30,11 @@ rustPlatform.buildRustPackage rec {
pkg-config
];
buildInputs =
[
buildInputs = [
libgit2
openssl
zlib
]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
meta = with lib; {
description = "A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere";

View File

@ -16,7 +16,10 @@ buildGoModule rec {
vendorHash = "sha256-FzGDVMKzAjISb4P7/vBIBTbBWpyAUnR26gXcvUWnjHw=";
ldflags = ["-s" "-w"];
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "This program uses the Chrome DevTools Protocol to drive a Chrome session that downloads your photos stored in Google Photos";

View File

@ -16,9 +16,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-A83pzY+c4kz59tHEc6hRd0Zp8Uj96KdrenD9RDWwavQ=";
};
buildInputs =
lib.optionals stdenv.isDarwin
[darwin.apple_sdk.frameworks.Security];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
buildAndTestSubdir = "hcctl";
@ -29,7 +27,10 @@ rustPlatform.buildRustPackage rec {
meta = with lib; {
description = "Simple CLI tool to keep a track of your https://healthchecks.io account";
homepage = "https://msfjarvis.dev/g/healthchecks-rs";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "hcctl";
};

View File

@ -16,9 +16,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-A83pzY+c4kz59tHEc6hRd0Zp8Uj96KdrenD9RDWwavQ=";
};
buildInputs =
lib.optionals stdenv.isDarwin
[darwin.apple_sdk.frameworks.Security];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
buildAndTestSubdir = "monitor";
@ -29,7 +27,10 @@ rustPlatform.buildRustPackage rec {
meta = with lib; {
description = "CLI tool to run shell jobs and report status to https://healthchecks.io";
homepage = "https://msfjarvis.dev/g/healthchecks-rs";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "healthchecks-monitor";
};

View File

@ -20,15 +20,16 @@ rustPlatform.buildRustPackage rec {
doCheck = false;
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
meta = with lib; {
description = "A CLI for katbin";
homepage = "https://github.com/SphericalKat/katbin-cli";
changelog = "https://github.com/SphericalKat/katbin-cli/blob/${src.rev}/CHANGELOG.md";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "katbin";
};

View File

@ -6,7 +6,8 @@
darwin,
lib,
inputs,
}: let
}:
let
inherit (inputs) fenix rust-manifest;
inherit ((import fenix { inherit pkgs; })) fromManifestFile;
@ -15,8 +16,8 @@ in
(makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
})
.buildRustPackage rec {
}).buildRustPackage
rec {
pname = "linkleaner";
version = "2.0.0";

View File

@ -18,9 +18,7 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-cGrrv0fDD0H2tvUNyNK9u5Qyd6JUXCztDIPmcmtZ7w4=";
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
meta = with lib; {
description = "Yet another nix cli helper";

View File

@ -16,7 +16,10 @@ buildGoModule {
vendorHash = "sha256-6Y8SmgH5SFvkw3YQh8SlSktJsctped8as1FCdIc4FQc=";
ldflags = ["-s" "-w"];
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "A Patreon Image Downloader";

View File

@ -22,7 +22,10 @@ buildGoModule rec {
vendorHash = "sha256-1d6EKEvo4XNDXRtbdnKkqyF9y0LPPHWKu9X/wYnbmas=";
ldflags = ["-s" "-w"];
ldflags = [
"-s"
"-w"
];
meta = with lib; {
description = "An SSH and GPG agent which you can use with your PIV hardware security device (e.g. a Yubikey";

View File

@ -29,7 +29,10 @@ stdenv.mkDerivation (finalAttrs: {
"-DBUILD_AUV3_PLUGIN=OFF"
];
nativeBuildInputs = [cmake pkg-config];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
freetype

View File

@ -23,7 +23,10 @@ rustPlatform.buildRustPackage rec {
meta = with lib; {
description = "Simple CLI tool to watch directories and move their files to a single dumping ground";
homepage = "https://github.com/msfjarvis/rucksack";
license = with licenses; [asl20 mit];
license = with licenses; [
asl20
mit
];
maintainers = with maintainers; [ msfjarvis ];
mainProgram = "rucksack";
};

View File

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
users.users.msfjarvis = {
name = "msfjarvis";
home = "/Users/msfjarvis";

View File

@ -3,17 +3,15 @@
lib,
pkgs,
...
}: {
}:
{
imports = [
./hardware-configuration.nix
./sd-image.nix
];
# Pi kernel does not build all modules so this allows some to be missing.
nixpkgs.overlays = [
(_: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // {allowMissing = true;});
})
(_: super: { makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; }); })
];
topology.self.name = "Raspberry Pi";
@ -85,9 +83,7 @@
enable = true;
user = "root";
group = "root";
sources = [
"/var/lib/qbittorrent/downloads"
];
sources = [ "/var/lib/qbittorrent/downloads" ];
target = "/media/.omg";
file_filter = "*.mp4";
};

View File

@ -1,19 +1,12 @@
{ lib, modulesPath, ... }:
{
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.supportedFilesystems = [ "ntfs" ];
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
fileSystems."/media" = {
device = "/dev/disk/by-uuid/1d9cbc92-8ea9-4ae7-8c8f-5f72c3d75626";
fsType = "ext4";
options = [
"nofail"
];
options = [ "nofail" ];
};
}

View File

@ -4,20 +4,24 @@
lib,
pkgs,
...
}: {
}:
{
nixpkgs.crossSystem.system = "aarch64-linux";
imports = [
(modulesPath + "/installer/sd-card/sd-image.nix")
];
imports = [ (modulesPath + "/installer/sd-card/sd-image.nix") ];
boot = {
consoleLogLevel = lib.mkDefault 7;
kernelParams = ["console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0"];
kernelParams = [
"console=ttyS0,115200n8"
"console=ttyAMA0,115200n8"
"console=tty0"
];
};
sdImage = {
populateFirmwareCommands = let
populateFirmwareCommands =
let
configTxt = pkgs.writeText "config.txt" ''
[pi3]
kernel=u-boot-rpi3.bin
@ -39,7 +43,8 @@
# when attempting to show low-voltage or overtemperature warnings.
avoid_warnings=1
'';
in ''
in
''
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/firmware/)
# Add the config
cp ${configTxt} firmware/config.txt

View File

@ -2,12 +2,10 @@
config,
lib,
pkgs,
inputs,
...
}: {
imports = [
./hardware-configuration.nix
];
}:
{
imports = [ ./hardware-configuration.nix ];
boot = {
# Only enable for first installation
@ -190,26 +188,16 @@
{
job_name = "wailord";
static_configs = [
{
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
}
{ targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ]; }
];
}
{
job_name = "caddy";
static_configs = [
{
targets = ["127.0.0.1:2019"];
}
];
static_configs = [ { targets = [ "127.0.0.1:2019" ]; } ];
}
{
job_name = "miniflux";
static_configs = [
{
targets = [config.services.miniflux.config.LISTEN_ADDR];
}
];
static_configs = [ { targets = [ config.services.miniflux.config.LISTEN_ADDR ]; } ];
}
];
};

View File

@ -1,7 +1,15 @@
{modulesPath, ...}: {
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.binfmt.emulatedSystems = ["i686-linux" "x86_64-linux"];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"];
boot.binfmt.emulatedSystems = [
"i686-linux"
"x86_64-linux"
];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"xen_blkfront"
];
boot.initrd.kernelModules = [ "nvme" ];
disko.devices = {
disk = {

View File

@ -3,10 +3,9 @@
config,
inputs,
...
}: {
imports = [
./hardware-configuration.nix
];
}:
{
imports = [ ./hardware-configuration.nix ];
topology.self.name = "Desktop";
@ -50,7 +49,10 @@
users.users.msfjarvis = {
isNormalUser = true;
description = "Harsh Shandilya";
extraGroups = ["networkmanager" "wheel"];
extraGroups = [
"networkmanager"
"wheel"
];
packages = with pkgs; [
age
attic
@ -99,7 +101,14 @@
nix-update
jarvis.patreon-dl
jarvis.pidcat
(python312.withPackages (ps: with ps; [beautifulsoup4 black requests virtualenv]))
(python312.withPackages (
ps: with ps; [
beautifulsoup4
black
requests
virtualenv
]
))
scrcpy
smile
sshfs
@ -141,10 +150,12 @@
group = "users";
};
services.rucksack = let
services.rucksack =
let
inherit (config.users.users.msfjarvis) home;
minecraft = name: "${home}/Games/PrismLauncher/instances/${name}/.minecraft/screenshots/";
in {
in
{
enable = true;
sources = [
(minecraft "1.21")

View File

@ -6,13 +6,19 @@
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix
}
) { src = ./.; }).defaultNix

View File

@ -15,20 +15,26 @@
inputs.flake-compat.url = "github:nix-community/flake-compat";
inputs.flake-compat.flake = false;
outputs = {
outputs =
{
nixpkgs,
devshell,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in {
in
{
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
bash = {
interactive = "";
};
env = [
{
@ -47,5 +53,6 @@
zlib
];
};
});
}
);
}

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix
}
) { src = ./.; }).shellNix

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix
}
) { src = ./.; }).defaultNix

View File

@ -20,22 +20,31 @@
inputs.nix-vscode-extensions.inputs.flake-utils.follows = "flake-utils";
inputs.nix-vscode-extensions.inputs.flake-compat.follows = "flake-compat";
outputs = {
outputs =
{
nixpkgs,
devshell,
flake-utils,
nix-vscode-extensions,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [devshell.overlays.default nix-vscode-extensions.overlays.default];
overlays = [
devshell.overlays.default
nix-vscode-extensions.overlays.default
];
};
in {
in
{
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
bash = {
interactive = "";
};
env = [
{
@ -63,5 +72,6 @@
})
];
};
});
}
);
}

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix
}
) { src = ./.; }).shellNix

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix
}
) { src = ./.; }).defaultNix

View File

@ -15,20 +15,26 @@
inputs.flake-compat.url = "github:nix-community/flake-compat";
inputs.flake-compat.flake = false;
outputs = {
outputs =
{
nixpkgs,
devshell,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in {
in
{
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
bash = {
interactive = "";
};
env = [
{
@ -37,9 +43,8 @@
}
];
packages = with pkgs; [
nodejs_18
];
packages = with pkgs; [ nodejs_18 ];
};
});
}
);
}

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix
}
) { src = ./.; }).shellNix

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix
}
) { src = ./.; }).defaultNix

View File

@ -15,20 +15,26 @@
inputs.flake-compat.url = "github:nix-community/flake-compat";
inputs.flake-compat.flake = false;
outputs = {
outputs =
{
nixpkgs,
devshell,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
};
in {
in
{
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
bash = {
interactive = "";
};
env = [
{
@ -37,9 +43,8 @@
}
];
packages = with pkgs; [
python312
];
packages = with pkgs; [ python312 ];
};
});
}
);
}

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix
}
) { src = ./.; }).shellNix

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.defaultNix
}
) { src = ./.; }).defaultNix

View File

@ -24,7 +24,8 @@
inputs.flake-compat.url = "github:nix-community/flake-compat";
inputs.flake-compat.flake = false;
outputs = {
outputs =
{
nixpkgs,
advisory-db,
crane,
@ -33,7 +34,9 @@
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlays.default ];
@ -54,22 +57,28 @@
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { doCheck = false; });
my-rust-package = craneLib.buildPackage (commonArgs // { doCheck = false; });
my-rust-package-clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
});
my-rust-package-clippy = craneLib.cargoClippy (commonArgs // { inherit cargoArtifacts; });
my-rust-package-fmt = craneLib.cargoFmt (commonArgs // { });
my-rust-package-audit = craneLib.cargoAudit (commonArgs // { inherit advisory-db; });
my-rust-package-nextest = craneLib.cargoNextest (commonArgs
my-rust-package-nextest = craneLib.cargoNextest (
commonArgs
// {
inherit cargoArtifacts;
src = ./.;
partitions = 1;
partitionType = "count";
});
in {
}
);
in
{
checks = {
inherit my-rust-package my-rust-package-audit my-rust-package-clippy my-rust-package-fmt my-rust-package-nextest;
inherit
my-rust-package
my-rust-package-audit
my-rust-package-clippy
my-rust-package-fmt
my-rust-package-nextest
;
};
packages.default = my-rust-package;
@ -77,7 +86,9 @@
apps.default = flake-utils.lib.mkApp { drv = my-rust-package; };
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
bash = {
interactive = "";
};
env = [
{
@ -93,5 +104,6 @@
stdenv.cc
];
};
});
}
);
}

View File

@ -1,8 +1,9 @@
(import (let
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/nix-community/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) {src = ./.;})
.shellNix
}
) { src = ./.; }).shellNix