mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-12-26 14:14:58 +08:00
add basic home-manager test
This commit is contained in:
parent
048d81b223
commit
8369461ff4
3 changed files with 49 additions and 0 deletions
14
checks/home-manager.nix
Normal file
14
checks/home-manager.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
imports = [
|
||||||
|
../modules/home-manager/sops.nix
|
||||||
|
];
|
||||||
|
home.stateVersion = "25.05";
|
||||||
|
home.username = "sops-user";
|
||||||
|
home.homeDirectory = "/home/sops-user";
|
||||||
|
home.enableNixpkgsReleaseCheck = false;
|
||||||
|
|
||||||
|
sops.age.generateKey = true;
|
||||||
|
sops.age.keyFile = "${config.home.homeDirectory}/.age-key.txt";
|
||||||
|
sops.secrets.test_key = { };
|
||||||
|
sops.defaultSopsFile = ../pkgs/sops-install-secrets/test-assets/secrets.yaml;
|
||||||
|
}
|
||||||
21
flake.lock
generated
21
flake.lock
generated
|
|
@ -1,5 +1,25 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731832479,
|
||||||
|
"narHash": "sha256-icDDuYwJ0avTMZTxe1qyU/Baht5JOqw4pb5mWpR+hT0=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "5056a1cf0ce7c2a08ab50713b6c4af77975f6111",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-darwin": {
|
"nix-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -54,6 +74,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
|
|
|
||||||
14
flake.nix
14
flake.nix
|
|
@ -6,6 +6,9 @@
|
||||||
inputs.nix-darwin.url = "github:LnL7/nix-darwin";
|
inputs.nix-darwin.url = "github:LnL7/nix-darwin";
|
||||||
inputs.nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
inputs.home-manager.url = "github:nix-community/home-manager";
|
||||||
|
inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nixConfig.extra-substituters = ["https://cache.thalheim.io"];
|
nixConfig.extra-substituters = ["https://cache.thalheim.io"];
|
||||||
nixConfig.extra-trusted-public-keys = ["cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc="];
|
nixConfig.extra-trusted-public-keys = ["cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc="];
|
||||||
outputs = {
|
outputs = {
|
||||||
|
|
@ -13,6 +16,7 @@
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nixpkgs-stable,
|
nixpkgs-stable,
|
||||||
nix-darwin,
|
nix-darwin,
|
||||||
|
home-manager,
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
systems = [
|
systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
|
|
@ -49,6 +53,16 @@
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
legacyPackages = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux" "aarch64-darwin"] (system: let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
homeConfigurations.sops = home-manager.lib.homeManagerConfiguration {
|
||||||
|
modules = [
|
||||||
|
./checks/home-manager.nix
|
||||||
|
];
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
packages = forAllSystems (system:
|
packages = forAllSystems (system:
|
||||||
import ./default.nix {
|
import ./default.nix {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue