refactor flake
This commit is contained in:
64
flake.lock
generated
64
flake.lock
generated
@@ -18,19 +18,36 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775087534,
|
||||
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1762844143,
|
||||
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=",
|
||||
"lastModified": 1776705249,
|
||||
"narHash": "sha256-3cg0CfzLLq2ay8SzAoNbI2OJkWY1H3kudrzA6hL14FM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
|
||||
"rev": "cc3f2ee0b3909e42334f34720ccac109a7e67068",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@@ -49,10 +66,47 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib_2": {
|
||||
"locked": {
|
||||
"lastModified": 1774748309,
|
||||
"narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "333c4e0545a6da976206c74db8773a1645b5870a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"wildfly": "wildfly"
|
||||
}
|
||||
},
|
||||
"wildfly": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1776706386,
|
||||
"narHash": "sha256-en72yqmDrm20Q+W0COp9I+Lc4j8NdeqKuGmYuZeD/yQ=",
|
||||
"owner": "0qln",
|
||||
"repo": "wildfly",
|
||||
"rev": "87fdb70a9877ee697790f8e2edfda4bd3091616b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "0qln",
|
||||
"repo": "wildfly",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
50
flake.nix
50
flake.nix
@@ -3,21 +3,18 @@
|
||||
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
wildfly = {
|
||||
url = "github:0qln/wildfly";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
flake-parts,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [];
|
||||
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
||||
perSystem = {
|
||||
config,
|
||||
self',
|
||||
inputs',
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
@@ -50,40 +47,7 @@
|
||||
]))
|
||||
];
|
||||
|
||||
wildfly = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "wildfly-39.0.0.Final";
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/wildfly/wildfly/releases/download/39.0.0.Final/wildfly-39.0.0.Final.zip";
|
||||
hash = "sha256-nfdb4doRRn4AwMQZkNYwIDBKIq4iY6diFX/WlPFQqZI=";
|
||||
};
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r $src/* $out/
|
||||
'';
|
||||
};
|
||||
|
||||
wildfly-fhs = pkgs.buildFHSEnv {
|
||||
name = "wildfly-fhs";
|
||||
targetPkgs = pkgs:
|
||||
with pkgs; [
|
||||
openjdk21
|
||||
bash
|
||||
coreutils
|
||||
];
|
||||
runScript = "${wildfly}/bin/standalone.sh";
|
||||
profile =
|
||||
# bash
|
||||
''
|
||||
export WILDFLY_BASE_DIR="$HOME/.wildfly-fhs-base"
|
||||
mkdir -p "$WILDFLY_BASE_DIR"/{log,data,deployments,tmp,configuration}
|
||||
if [ ! -f "$WILDFLY_BASE_DIR/configuration/standalone.xml" ]; then
|
||||
cp -r ${wildfly}/standalone/configuration/* "$WILDFLY_BASE_DIR/configuration/"
|
||||
chmod -R u+w "$WILDFLY_BASE_DIR/configuration/"
|
||||
fi
|
||||
export JBOSS_HOME=${wildfly}
|
||||
export JBOSS_BASE_DIR="$WILDFLY_BASE_DIR"
|
||||
'';
|
||||
};
|
||||
wildfly-fhs = inputs.wildfly.packages.${system}.wildfly-fhs;
|
||||
in {
|
||||
# Per-system attributes can be defined here. The self' and inputs'
|
||||
# module parameters provide easy access to attributes of the same
|
||||
|
||||
Reference in New Issue
Block a user