flake: Setup a devShell for haskell
This commit is contained in:
parent
bc675f00ac
commit
329b60662a
2 changed files with 201 additions and 44 deletions
113
flake.lock
generated
113
flake.lock
generated
|
|
@ -103,6 +103,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668681692,
|
"lastModified": 1668681692,
|
||||||
|
|
@ -136,6 +152,45 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1701680307,
|
||||||
|
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1703887061,
|
||||||
|
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -362,6 +417,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-stable_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1704874635,
|
||||||
|
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-23.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705316053,
|
"lastModified": 1705316053,
|
||||||
|
|
@ -441,6 +512,30 @@
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pre-commit-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1708018599,
|
||||||
|
"narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
|
|
@ -452,13 +547,14 @@
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-droid": "nixpkgs-droid",
|
"nixpkgs-droid": "nixpkgs-droid",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
"snm": "snm"
|
"snm": "snm"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"snm": {
|
"snm": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"blobs": "blobs",
|
"blobs": "blobs",
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_2",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-22_11": "nixpkgs-22_11",
|
"nixpkgs-22_11": "nixpkgs-22_11",
|
||||||
"nixpkgs-23_05": "nixpkgs-23_05",
|
"nixpkgs-23_05": "nixpkgs-23_05",
|
||||||
|
|
@ -494,6 +590,21 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1659877975,
|
||||||
|
|
|
||||||
132
flake.nix
132
flake.nix
|
|
@ -4,6 +4,9 @@
|
||||||
nixpkgs-droid.url = "github:NixOS/nixpkgs/nixos-23.05";
|
nixpkgs-droid.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||||
|
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
@ -45,51 +48,94 @@
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { home-manager, nixpkgs, nixpkgs-unstable, ... }@inputs: {
|
outputs = { self, home-manager, nixpkgs, nixpkgs-unstable, pre-commit-hooks
|
||||||
nixosConfigurations."thrall" = nixpkgs.lib.nixosSystem {
|
, ... }@inputs: {
|
||||||
system = "x86_64-linux";
|
checks."x86_64-linux" = let
|
||||||
specialArgs = { inherit inputs; };
|
system = "x86_64-linux";
|
||||||
modules = let
|
pkgs = import nixpkgs { inherit system; };
|
||||||
postfix-overlay = final: prev: {
|
in {
|
||||||
postfix = nixpkgs-unstable.legacyPackages."x86_64-linux".postfix;
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||||
};
|
src = ./.;
|
||||||
in [
|
settings = { ormolu.defaultExtensions = [ "GHC2021" ]; };
|
||||||
({ inputs, lib, ... }: {
|
tools.fourmolu = pkgs.haskellPackages.fourmolu;
|
||||||
nixpkgs = {
|
hooks = {
|
||||||
config.allowUnfree = true;
|
nixfmt.enable = true;
|
||||||
overlays = with inputs; [ emacs.overlay postfix-overlay ];
|
fourmolu.enable = true;
|
||||||
|
hpack.enable = true;
|
||||||
|
hlint.enable = true;
|
||||||
};
|
};
|
||||||
nix.registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
};
|
||||||
})
|
};
|
||||||
./hosts/thrall
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.alex = import ./home/alex/cli.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations."dregil" = nixpkgs-unstable.lib.nixosSystem {
|
nixosConfigurations."thrall" = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [ ./hosts/dregil ];
|
modules = let
|
||||||
};
|
postfix-overlay = final: prev: {
|
||||||
|
postfix = nixpkgs-unstable.legacyPackages."x86_64-linux".postfix;
|
||||||
nixosConfigurations."igor" = nixpkgs-unstable.lib.nixosSystem {
|
};
|
||||||
system = "x86_64-linux";
|
in [
|
||||||
specialArgs = { inherit inputs; };
|
({ inputs, lib, ... }: {
|
||||||
modules = [ ./hosts/igor ];
|
nixpkgs = {
|
||||||
};
|
config.allowUnfree = true;
|
||||||
|
overlays = with inputs; [ emacs.overlay postfix-overlay ];
|
||||||
nixOnDroidConfigurations.default = with inputs;
|
};
|
||||||
nix-on-droid.lib.nixOnDroidConfiguration {
|
nix.registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
||||||
modules = [
|
})
|
||||||
./hosts/redmi
|
./hosts/thrall
|
||||||
{ nix.registry.nixpkgs.flake = nixpkgs-droid; }
|
home-manager.nixosModules.home-manager
|
||||||
{ nix.nixPath = [ "nixpkgs=${nixpkgs-droid}" ]; }
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.alex = import ./home/alex/cli.nix;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
nixosConfigurations."dregil" = nixpkgs-unstable.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = { inherit inputs; };
|
||||||
|
modules = [ ./hosts/dregil ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosConfigurations."igor" = nixpkgs-unstable.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = { inherit inputs; };
|
||||||
|
modules = [ ./hosts/igor ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixOnDroidConfigurations.default = with inputs;
|
||||||
|
nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
|
modules = [
|
||||||
|
./hosts/redmi
|
||||||
|
{ nix.registry.nixpkgs.flake = nixpkgs-droid; }
|
||||||
|
{ nix.nixPath = [ "nixpkgs=${nixpkgs-droid}" ]; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells."x86_64-linux".default = let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in pkgs.haskellPackages.shellFor {
|
||||||
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
|
|
||||||
|
packages = p: [ p.xmonad p.xmonad-contrib ];
|
||||||
|
|
||||||
|
withHoogle = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
haskellPackages.haskell-language-server
|
||||||
|
haskellPackages.fourmolu
|
||||||
|
haskellPackages.hspec-discover
|
||||||
|
haskellPackages.doctest
|
||||||
|
haskellPackages.xmonad
|
||||||
|
haskellPackages.xmonad-contrib
|
||||||
|
cabal-install
|
||||||
|
ghcid
|
||||||
|
nixfmt
|
||||||
|
hpack
|
||||||
|
hlint
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue