aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-09-04 17:03:21 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-09-04 17:03:21 +0900
commit945cce2f5e487492730e06e13e920e08c55d8084 (patch)
treebbc0147dd26df2c1e950d7b2b8242223ee869e68 /flake.nix
parent5c3e7cf6640721fc2cb5006c879bf570cedf1902 (diff)
nix: implement nixos module
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix59
1 files changed, 22 insertions, 37 deletions
diff --git a/flake.nix b/flake.nix
index 1e31f3b5..aa10f3db 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,56 +1,41 @@
{
- description = "fortify development environment";
+ description = "fortify sandbox tool and nixos module";
inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/24.05";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
};
outputs =
{ self, nixpkgs }:
let
- supportedSystems = [ "x86_64-linux" ];
- forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
+ supportedSystems = [
+ "aarch64-linux"
+ "i686-linux"
+ "x86_64-linux"
+ ];
+
+ forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
+ nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
- devShells = forAllSystems (
+ nixosModules.fortify = import ./nixos.nix;
+
+ packages = forAllSystems (
system:
let
- pkgs = import nixpkgs { inherit system; };
+ pkgs = nixpkgsFor.${system};
in
{
- default =
- let
- inherit (pkgs)
- mkShell
- buildGoModule
- acl
- xorg
- ;
- in
- mkShell {
- packages = [
- (buildGoModule rec {
- pname = "fortify";
- version = "0.0.0-flake";
-
- src = ./.;
- vendorHash = null; # we have no Go dependencies :3
+ default = self.packages.${system}.fortify;
- ldflags = [
- "-s"
- "-w"
- "-X"
- "main.Version=v${version}"
- ];
-
- buildInputs = [
- acl
- xorg.libxcb
- ];
- })
- ];
- };
+ fortify = pkgs.callPackage ./package.nix { };
}
);
+
+ devShells = forAllSystems (system: {
+ default = nixpkgsFor.${system}.mkShell {
+ buildInputs = with nixpkgsFor.${system}; [ self.packages.${system}.fortify ];
+ };
+ });
};
}