add patch feature (#6)

* add patch feature

* refactor
This commit is contained in:
Dennis 2023-12-30 17:18:25 +01:00 committed by GitHub
parent 5835291841
commit 85ab0e229e
3 changed files with 82 additions and 19 deletions

75
flake.lock generated
View File

@ -1,5 +1,23 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -7,11 +25,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1703657526, "lastModified": 1703838268,
"narHash": "sha256-C3fQG/tasnhtfJb0cvXthMDUJ/OLgCKNLqfMuR/M+0k=", "narHash": "sha256-SRg5nXcdPnrsQR2MTAp7en0NyJnQ2wB1ivmsgEbvN+o=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d1d950841d230490f308f5fcf8c0d4f2bd3f24a7", "rev": "2aff324cf65f5f98f89d878c056b779466b17db8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +40,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1703545041, "lastModified": 1703879120,
"narHash": "sha256-nvQA+k1rSszrf4kA4eK2i/SGbzoXyoKHzzyzq/Jca1w=", "narHash": "sha256-oMJ5xtDswlBWxs0DT/aYKEUIhjEpGZJ9GbIxOclYP8I=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "a15b6e525f5737a47b4ce28445c836996fb2ea8c", "rev": "22ae59fec26591ef72ce4ccb5538c42c5f090fe3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -43,11 +61,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1703639290, "lastModified": 1703899776,
"narHash": "sha256-Bflli82UQGjhlg4Gh7FVaYG/CmLa4D9irv2qx2PxpFQ=", "narHash": "sha256-I1hE5u3VR/1h2ZM0Q4B1L1BccLFGNfMPPQyy3CRLFqs=",
"owner": "SuperSandro2000", "owner": "SuperSandro2000",
"repo": "nixos-modules", "repo": "nixos-modules",
"rev": "4251f23f93ef6d38fc16884758f01862301b9590", "rev": "2e9865e82f060907d4be682a514bdf0af86ad25e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -58,11 +76,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1703438236, "lastModified": 1703637592,
"narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", "narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", "rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -72,12 +90,30 @@
"type": "github" "type": "github"
} }
}, },
"patch-bitwarden-directory-connector": {
"locked": {
"lastModified": 1703932440,
"narHash": "sha256-82Rm0vo+6mVOGp7FYZ4dY9TJVLFGY8JnALHRMwLA4Do=",
"owner": "Silver-Golden",
"repo": "nixpkgs",
"rev": "5188cc51aef34579ce9a7d7a8116d55e4e1b7ba6",
"type": "github"
},
"original": {
"owner": "Silver-Golden",
"ref": "bitwarden-directory-connector_pkgs",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixos-modules": "nixos-modules", "nixos-modules": "nixos-modules",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"patch-bitwarden-directory-connector": "patch-bitwarden-directory-connector",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
@ -103,6 +139,21 @@
"repo": "sops-nix", "repo": "sops-nix",
"type": "github" "type": "github"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -3,7 +3,11 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
patch-bitwarden-directory-connector.url = "github:Silver-Golden/nixpkgs/bitwarden-directory-connector_pkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
flake-utils.url = "github:numtide/flake-utils";
nixos-modules = { nixos-modules = {
url = "github:SuperSandro2000/nixos-modules"; url = "github:SuperSandro2000/nixos-modules";
@ -24,7 +28,7 @@
}; };
}; };
outputs = { nixpkgs, nixos-hardware, nixos-modules, home-manager, sops-nix, ... }: outputs = { nixpkgs, nixos-modules, home-manager, sops-nix, ... }@inputs:
let let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
src = builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) ./.; src = builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) ./.;
@ -41,12 +45,20 @@
, users ? [ "dennis" ] , users ? [ "dennis" ]
, ,
}: lib.nixosSystem { }: lib.nixosSystem {
inherit system; inherit system lib;
modules = [ modules = [
{
nixpkgs.overlays = [
(_self: super: {
bitwarden-directory-connector-cli = inputs.patch-bitwarden-directory-connector.legacyPackages.${system}.bitwarden-directory-connector-cli;
})
];
}
nixos-modules.nixosModule nixos-modules.nixosModule
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
"${inputs.patch-bitwarden-directory-connector}/nixos/modules/services/security/bitwarden-directory-connector-cli.nix"
./systems/programs.nix ./systems/programs.nix
./systems/configuration.nix ./systems/configuration.nix
./systems/${hostname}/hardware.nix ./systems/${hostname}/hardware.nix
@ -72,27 +84,27 @@
jeeves-jr = constructSystem { jeeves-jr = constructSystem {
hostname = "jeeves-jr"; hostname = "jeeves-jr";
users = [ users = [
"richie"
"alice" "alice"
"dennis" "dennis"
"richie"
]; ];
}; };
palatine-hill = constructSystem { palatine-hill = constructSystem {
hostname = "palatine-hill"; hostname = "palatine-hill";
users = [ users = [
"richie"
"alice" "alice"
"dennis" "dennis"
"richie"
]; ];
}; };
photon = constructSystem { photon = constructSystem {
hostname = "photon"; hostname = "photon";
users = [ users = [
"richie"
"alice" "alice"
"dennis" "dennis"
"richie"
]; ];
}; };
}; };

View File

@ -28,7 +28,7 @@ in
filter = "apache-nohome"; filter = "apache-nohome";
action = ''iptables-multiport[name=HTTP, port="http,https"]''; action = ''iptables-multiport[name=HTTP, port="http,https"]'';
logpath = "/var/log/httpd/error_log*"; logpath = "/var/log/httpd/error_log*";
backend = "auto"; backend = "systemd";
findtime = 600; findtime = 600;
bantime = 600; bantime = 600;
maxretry = 5; maxretry = 5;