Skip to content

Commit

Permalink
run deadnix and nix fmt (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
steveej committed Mar 20, 2024
1 parent 382172c commit 3082865
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 82 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# url = "https://github.com/maackle.keys";
# flake = false;
# };

# hash mismatch 20230821
# keys_neonphog = {
# url = "https://github.com/neonphog.keys";
Expand Down
7 changes: 0 additions & 7 deletions modules/flake-parts/_template.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{
# System independent arguments.
self,
lib,
inputs,
...
}: {
perSystem = {
# Arguments specific to the `perSystem` context.
config,
self',
inputs',
pkgs,
...
}: {
# system specific outputs like, apps, checks, packages
Expand Down
1 change: 0 additions & 1 deletion modules/flake-parts/apps.ssh-/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}: {
perSystem = {pkgs, ...}: let
mkSsh = {
attrName,
hostName,
deployUser,
}:
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/darwinConfigurations.macos-01/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
self,
lib,
inputs,
config,
...
}: let
system = "aarch64-darwin";
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/darwinConfigurations.macos-02/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
self,
lib,
inputs,
config,
...
}: let
system = "x86_64-darwin";
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/darwinConfigurations.macos-03/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
self,
lib,
inputs,
config,
...
}: let
system = "aarch64-darwin";
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/darwinConfigurations.macos-04/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
self,
lib,
inputs,
config,
...
}: let
system = "aarch64-darwin";
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/darwinConfigurations.macos-05/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
self,
lib,
inputs,
config,
...
}: let
system = "aarch64-darwin";
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/darwinConfigurations.macos-06/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
self,
lib,
inputs,
config,
...
}: let
system = "x86_64-darwin";
Expand Down
14 changes: 2 additions & 12 deletions modules/flake-parts/formatter.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
self,
lib,
...
}: {
perSystem = {
config,
self',
inputs',
pkgs,
...
}: {
{...}: {
perSystem = {pkgs, ...}: {
# define formatter used by `nix fmt`
formatter = pkgs.alejandra;
};
Expand Down
2 changes: 0 additions & 2 deletions modules/flake-parts/microvms.nix-cache/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
name,
self,
config,
lib,
pkgs,
...
}: let
Expand Down
7 changes: 1 addition & 6 deletions modules/flake-parts/microvms.nix-cache/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ in {
# Include the microvm module
inputs.microvm.nixosModules.microvm
# Add more modules here
({
config,
lib,
pkgs,
...
}: {
({config, ...}: {
microvm.mem = 1024 * 8;
microvm.vcpu = 4;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
config,
self,
lib,
inputs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
config,
lib,
inputs,
self,
pkgs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
config,
self,
lib,
inputs,
Expand Down
11 changes: 1 addition & 10 deletions modules/flake-parts/packages.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
{
# System independent arguments.
self,
lib,
inputs,
...
}: {
perSystem = {
# Arguments specific to the `perSystem` context.
config,
self',
inputs',
pkgs,
...
}: {
# system specific outputs like, apps, checks, packages

packages = {
reverse-proxy-nix-cache = let

in pkgs.writeShellScriptBin "reverse-proxy-nix-cache" ''
reverse-proxy-nix-cache = pkgs.writeShellScriptBin "reverse-proxy-nix-cache" ''
sudo ${pkgs.caddy}/bin/caddy reverse-proxy --from :80 --to :5000
'';

};
};
flake = {
Expand Down
2 changes: 0 additions & 2 deletions modules/nixos/cachix-watch.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
inputs,
pkgs,
config,
lib,
magicPaths,
...
}: {
Expand Down
1 change: 0 additions & 1 deletion modules/nixos/github-runner-multi-arch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
self,
config,
lib,
magicPaths,
pkgs,
...
}: let
Expand Down
6 changes: 1 addition & 5 deletions modules/nixos/holo-deploy.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
config,
lib,
...
}: {
{lib, ...}: {
options = {
deployUser = lib.mkOption {
type = lib.types.str;
Expand Down
1 change: 0 additions & 1 deletion modules/nixos/macos-remote-builder.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
config,
lib,
pkgs,
...
Expand Down
1 change: 0 additions & 1 deletion modules/nixos/macos.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
Expand Down
3 changes: 1 addition & 2 deletions modules/nixos/nix-build-distributor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
speedFactor = 1;
supportedFeatures = config.nix.settings.experimental-features;
}

# macos-02
# - intel CPU
{
Expand All @@ -46,7 +46,6 @@
supportedFeatures = config.nix.settings.experimental-features;
}


# macos-04
# - m1 cpu
# - system integrity protection disabled
Expand Down
9 changes: 7 additions & 2 deletions modules/nixos/shared-darwin.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{ config, lib, pkgs, ...}: let
cleanup0sizeDrvs = (import ./shared-linux.nix { inherit config pkgs; }).systemd.services.nix-gc.preStart;
{
config,
lib,
pkgs,
...
}: let
cleanup0sizeDrvs = (import ./shared-linux.nix {inherit config pkgs;}).systemd.services.nix-gc.preStart;
in {
launchd.daemons.nix-gc.command = lib.mkForce (pkgs.writeShellScript "nix-gc" ''
${cleanup0sizeDrvs}
Expand Down
6 changes: 5 additions & 1 deletion modules/nixos/shared-linux.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ config, pkgs, ... }: {
{
config,
pkgs,
...
}: {
systemd.services.nix-gc.preStart = ''
# if the machine runs low on disk space it's possible for derivation files to be created but never get content which results in derivations that can't be removed by the gc. this is a workaround which finds and deletes those problem derivations.
echo Removing 0-size derivations if any exist...
Expand Down
1 change: 0 additions & 1 deletion modules/nixos/shared-nix-settings.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
config,
pkgs,
lib,
...
Expand Down
23 changes: 11 additions & 12 deletions modules/nixos/shared.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
config,
pkgs,
lib,
system,
...
}: let
in {
}: {
# Nix configuration shared between all hosts

imports = [
./holo-deploy.nix
]
# TODO: figure out why this results in infinite recursion
# ++ pkgs.stdenv.isLinux [
# ./shared-linux.nix
# ]
;
imports =
[
./holo-deploy.nix
]
# TODO: figure out why this results in infinite recursion
# ++ pkgs.stdenv.isLinux [
# ./shared-linux.nix
# ]
;

nix.package = lib.mkDefault pkgs.nixVersions.nix_2_17;

Expand Down Expand Up @@ -88,4 +87,4 @@ in {
else if config.deployUser == "root"
then "/root"
else "/home/${config.deployUser}";
}
}

0 comments on commit 3082865

Please sign in to comment.