refactor(flake): re-organise systems and modules
This commit is contained in:
parent
af70a9b56f
commit
eac470013b
32
flake.nix
32
flake.nix
|
@ -6,12 +6,17 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{ flake-parts, home-manager, nixpkgs, nixpkgs-unstable, self, ... }:
|
||||
outputs = inputs@{ flake-parts, self, ... }:
|
||||
let
|
||||
username = "opdavies";
|
||||
|
||||
nixos-system = import ./system/nixos { inherit inputs username; };
|
||||
wsl-system = import ./system/wsl2 { inherit inputs username; };
|
||||
in
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
perSystem = { pkgs, self', nixpkgs, ... }: {
|
||||
perSystem = { pkgs, self', ... }: {
|
||||
packages = {
|
||||
opdavies-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "opdavies-nvim";
|
||||
|
@ -24,28 +29,11 @@
|
|||
|
||||
flake = {
|
||||
nixosConfigurations = {
|
||||
nixedo = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
./system/nixos/nixedo/configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.opdavies = import ./home-manager/nixedo.nix;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
nixedo = nixos-system;
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
wsl2 = home-manager.lib.homeManagerConfiguration {
|
||||
modules = [ ./system/wsl2.nix ];
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
wsl2 = wsl-system;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
@ -22,11 +18,6 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
|
@ -42,7 +33,7 @@ in
|
|||
DefaultTimeoutStopSec=10s
|
||||
'';
|
||||
|
||||
networking.hostName = "nixedo"; # Define your hostname.
|
||||
# networking.hostName = "nixedo"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
21
system/nixos/default.nix
Normal file
21
system/nixos/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ inputs, username }:
|
||||
|
||||
let
|
||||
configuration = import ./configuration.nix;
|
||||
hardware-configuration = import ./hardware-configuration.nix;
|
||||
in
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager {
|
||||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users."${username}" = import ./home-manager.nix;
|
||||
};
|
||||
}
|
||||
|
||||
configuration
|
||||
hardware-configuration
|
||||
];
|
||||
}
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./modules/common.nix
|
||||
./modules/git.nix
|
||||
./modules/home-manager.nix
|
||||
./modules/tmux.nix
|
||||
./modules/zsh.nix
|
||||
../../home-manager/modules/common.nix
|
||||
../../home-manager/modules/git.nix
|
||||
../../home-manager/modules/home-manager.nix
|
||||
../../home-manager/modules/tmux.nix
|
||||
../../home-manager/modules/zsh.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "22.05";
|
|
@ -1,6 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ inputs, username }:
|
||||
|
||||
{
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
modules = [
|
||||
{
|
||||
imports = [
|
||||
../home-manager/modules/common.nix
|
||||
../home-manager/modules/git.nix
|
||||
|
@ -8,4 +10,8 @@
|
|||
../home-manager/modules/tmux.nix
|
||||
../home-manager/modules/zsh.nix
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue