Skip to content

Commit

Permalink
feat: jenkins + darwin (and linting)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarsel committed Oct 23, 2024
1 parent d2c8805 commit 06c9b20
Show file tree
Hide file tree
Showing 41 changed files with 834 additions and 618 deletions.
875 changes: 506 additions & 369 deletions SwarselSystems.org

Large diffs are not rendered by default.

110 changes: 64 additions & 46 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,104 +14,111 @@
};

inputs = {

nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";

systems.url = "github:nix-systems/default-linux";

# user-level configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};

# overlay to access bleeding edge emacs
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};

# nix user repository
# i use this mainly to not have to build all firefox extensions
# myself as well as for the emacs-init package (tbd)
nur.url = "github:nix-community/NUR";

# provides GL to non-NixOS hosts
nixgl.url = "github:guibou/nixGL";

# manages all theming using Home-Manager
stylix.url = "github:danth/stylix";

# nix secrets management
sops-nix.url = "github:Mic92/sops-nix";

# enable secure boot on NixOS
lanzaboote.url = "github:nix-community/lanzaboote";

# nix for android
nix-on-droid = {
url = "github:nix-community/nix-on-droid/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};

# generate NixOS images
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};

# hardware quirks on nix
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};

# dynamic library loading
nix-alien = {
url = "github:thiagokokada/nix-alien";
};

# automatic nintendo switch payload injection
nswitch-rcm-nix = {
url = "github:Swarsel/nswitch-rcm-nix";
};

# weekly updated nix-index database
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};

disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};

impermanence.url = "github:nix-community/impermanence";

zjstatus = {
url = "github:dj95/zjstatus";
};

fw-fanctrl = {
url = "github:TamtamHero/fw-fanctrl/packaging/nix";
inputs.nixpkgs.follows = "nixpkgs";
};

nix-darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};

};

outputs =
inputs@{ self
, nixpkgs
, nixpkgs-stable
, home-manager
, nix-darwin
, systems
, ...
}:
let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;

forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs (import systems) (
system:
Expand All @@ -120,7 +127,7 @@
config.allowUnfree = true;
}
);

# NixOS modules that can only be used on NixOS systems
nixModules = [
inputs.stylix.nixosModules.stylix
Expand All @@ -131,27 +138,27 @@
inputs.nswitch-rcm-nix.nixosModules.nswitch-rcm
./profiles/common/nixos
];

# Home-Manager modules wanted on non-NixOS systems
homeModules = [
inputs.stylix.homeManagerModules.stylix
];

# Home-Manager modules wanted on both NixOS and non-NixOS systems
mixedModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.nix-index-database.hmModules.nix-index
./profiles/common/home
];

in
{

inherit lib;
inherit mixedModules;
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home;

packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
devShells = forEachSystem
(pkgs:
Expand All @@ -171,7 +178,7 @@
inputs.emacs-overlay.overlay
inputs.nixgl.overlay
];

# NixOS setups - run home-manager as a NixOS module for better compatibility
# another benefit - full rebuild on nixos-rebuild switch
# run rebuild using `nswitch`
Expand All @@ -180,8 +187,8 @@
# Make sure to move hardware-configuration to the appropriate location, by default it is found in /etc/nixos/.

nixosConfigurations = {


sandbox = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
Expand All @@ -191,7 +198,7 @@
./profiles/sandbox/nixos.nix
];
};

threed = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = nixModules ++ [
Expand All @@ -205,28 +212,28 @@
}
];
};

fourside = lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = nixModules ++ [
./profiles/fourside
];
};

nbl-imba-2 = lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = nixModules ++ [
./profiles/nbl-imba-2
];
};

winters = lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./profiles/server/winters
];
};

#ovm swarsel
sync = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
Expand All @@ -235,7 +242,7 @@
./profiles/remote/oracle/sync/nixos.nix
];
};

#ovm swarsel
swatrix = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
Expand All @@ -250,26 +257,37 @@
# run rebuild using `hmswitch`

homeConfigurations = {

"swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
"swarsel@home-manager" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = homeModules ++ mixedModules ++ [
./profiles/home-manager
modules = homeModules ++ mixedModules ++ [
./profiles/home-manager
];
};

};

darwinConfigurations = {

"nbm-imba-166" = inputs.nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs outputs; };
modules = [
./profiles/nbm-imba-166
];
};

};

nixOnDroidConfigurations = {

mysticant = inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = pkgsFor.aarch64-linux;
pkgs = pkgsFor.aarch64-linux;
modules = [
./profiles/mysticant
];
};

};

};
Expand Down
4 changes: 4 additions & 0 deletions modules/home/darwin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{ lib, config, ... }:
{
options.swarselsystems.isDarwin = lib.mkEnableOption "darwin host";
}
1 change: 1 addition & 0 deletions modules/home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
monitors = import ./monitors.nix;
input = import ./input.nix;
nixos = import ./nixos.nix;
darwin = import ./darwin.nix;
waybar = import ./waybar.nix;
startup = import ./startup.nix;
wallpaper = import ./wallpaper.nix;
Expand Down
2 changes: 1 addition & 1 deletion modules/nixos/input.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, config, ... }:
{ lib, ... }:
let
inherit (lib) mkOption types;
in
Expand Down
1 change: 1 addition & 0 deletions modules/nixos/setup.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ in
options.swarselsystems.server.syncthing = lib.mkEnableOption "enable syncthing on server";
options.swarselsystems.server.restic = lib.mkEnableOption "enable restic backups on server";
options.swarselsystems.server.monitoring = lib.mkEnableOption "enable monitoring on server";
options.swarselsystems.server.jenkins = lib.mkEnableOption "enable jenkins on server";
}
4 changes: 2 additions & 2 deletions overlays/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ inputs, ... }: {
additions = final: _prev: import ../pkgs { pkgs = final; };
modifications = final: _prev: {
modifications = _: _prev: {
vesktop = _prev.vesktop.override {
withSystemVencord = true;
};
Expand Down Expand Up @@ -41,7 +41,7 @@
};
};

zjstatus = final: _prev: {
zjstatus = _: _prev: {
zjstatus = inputs.zjstatus.packages.${_prev.system}.default;
};

Expand Down
7 changes: 0 additions & 7 deletions pkgs/check/default.nix

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/fs-diff/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ writeShellApplication, sway }:
{ writeShellApplication }:

writeShellApplication {
name = "fs-diff";
Expand Down
7 changes: 0 additions & 7 deletions pkgs/pass-fuzzel-otp/default.nix

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/swarselcheck/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, sway, jq }:
{ writeShellApplication, kitty, element-desktop-wayland, vesktop, spotify-player, jq }:

writeShellApplication {
name = "swarselcheck";
Expand Down
Loading

0 comments on commit 06c9b20

Please sign in to comment.