Skip to content

Commit

Permalink
Merge pull request #89 from yuanw/standalone
Browse files Browse the repository at this point in the history
Standalone
  • Loading branch information
yuanwang-wf authored Aug 3, 2023
2 parents 423afd8 + 6cf1a1d commit bc2acd7
Show file tree
Hide file tree
Showing 16 changed files with 217 additions and 100 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ terraform.rc
.lego/
wireguard-keys
AdGuardHome.yaml
/.pre-commit-config.yaml

diff.json
1 change: 1 addition & 0 deletions devshell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# See https://haskell.flake.page/devshell#composing-devshells
inputsFrom = [
config.treefmt.build.devShell
config.pre-commit.devShell
];
};
};
Expand Down
129 changes: 112 additions & 17 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
};
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-flake.url = "github:srid/nixos-flake";
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
pre-commit.inputs.nixpkgs.follows = "nixpkgs";

};


Expand All @@ -47,13 +49,13 @@
];
imports = [
./devshell.nix
# ./packages
./hosts
./modules
# ./systemModule.nix
inputs.nixos-flake.flakeModule
inputs.pre-commit.flakeModule
inputs.treefmt-nix.flakeModule
];
perSystem.treefmt.imports = [ ./treefmt.nix ];
# https://github.com/cachix/pre-commit-hooks.nix/blame/30d1c34bdbfe3dd0b8fbdde3962180c56cf16f12/flake-module.nix
perSystem.pre-commit.settings.hooks.treefmt.enable = true;
};
}
22 changes: 14 additions & 8 deletions hosts/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ self, inputs, system, ... }:
let
nixosSystem = args:
inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args);
darwinSystem = args:
inputs.nix-darwin.lib.darwinSystem ({ specialArgs = { inherit inputs; }; } // args);
in
{
flake = {
nixosConfigurations = {
Expand Down Expand Up @@ -37,20 +43,20 @@
./yuan-mac.nix
];
};
WK01174 = self.nixos-flake.lib.mkMacosSystem "aarch64-darwin" {
imports = [
inputs.self.nixosModules.common
inputs.self.nixosModules.darwin
WK01174 = darwinSystem {
system = "aarch64-darwin";
modules = [
./wk01174.nix
];
};
wf17084 = self.nixos-flake.lib.mkMacosSystem "x86_64-darwin" {
imports = [
inputs.self.nixosModules.common
inputs.self.nixosModules.darwin
wf17084 = darwinSystem {
system = "x86_64-darwin" ;
modules = [
./wf17084.nix
];
};


};

};
Expand Down
11 changes: 9 additions & 2 deletions hosts/wf17084.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{ pkgs, config, ... }: {
{ pkgs, inputs, config, ... }:
{

imports = [
inputs.self.nixosModules.common
inputs.self.nixosModules.darwin
];
my = {
username = "yuanwang";
name = "Yuan Wang";
Expand All @@ -8,6 +13,8 @@
gpgKey = "19AD3F6B1A5BF3BF";
homeDirectory = "/Users/yuanwang";
};


home-manager.users.${config.my.username}.programs = {
go = {
enable = true;
Expand Down Expand Up @@ -77,6 +84,6 @@
mainWorkspaceDir = "$HOME/workiva";
};
wm.yabai.enable = true;
workShell.enable = true;
};
programs = { workShell.enable = true; };
}
11 changes: 9 additions & 2 deletions hosts/wk01174.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ pkgs, config, ... }: {
{ pkgs, inputs, config, ... }: {

imports = [
inputs.self.nixosModules.common
inputs.self.nixosModules.darwin
];

my = {
username = "yuanwang";
name = "Yuan Wang";
Expand Down Expand Up @@ -79,6 +85,7 @@
mainWorkspaceDir = "$HOME/workspaces";
};
wm.yabai.enable = true;

workShell.enable = true;
};
programs = { workShell.enable = true; };
}
12 changes: 6 additions & 6 deletions modules/common.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ flake, config, ... }:
{ inputs, config, ... }:
{
nix = {
# configureBuildUsers = true;
Expand Down Expand Up @@ -48,12 +48,12 @@
allowUnsupportedSystem = true;
};
overlays = [
flake.inputs.emacs.overlay
flake.inputs.nur.overlay
flake.inputs.agenix.overlays.default
inputs.emacs.overlay
inputs.nur.overlay
inputs.agenix.overlays.default
(_final: _prev: {
stable = flake.inputs.nixpkgs-stable.legacyPackages.${_prev.system};
mesa = flake.inputs.nixpkgs-stable.legacyPackages.${_prev.system}.mesa;
stable = inputs.nixpkgs-stable.legacyPackages.${_prev.system};
mesa = inputs.nixpkgs-stable.legacyPackages.${_prev.system}.mesa;
# use this variant if unfree packages are needed:
# unstable = import nixpkgs-unstable {
# inherit system;
Expand Down
11 changes: 1 addition & 10 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,7 @@
darwin.imports = [
./brew.nix
./wm/yabai.nix
../macintosh.nix
# ({ ... }: {
# })
./macintosh.nix
];


# desktop = ./desktop.nix;
# gnome = ./gnome.nix;
# gotosocial = ./gotosocial.nix;
# nix-remote-builders = ./nix-remote-builders.nix;
# server = ./server.nix;
};
}
12 changes: 6 additions & 6 deletions home.nix → modules/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
home.homeDirectory = config.my.homeDirectory;
# https://rycee.gitlab.io/home-manager/release-notes.html#sec-release-22.11
home.stateVersion = "22.11";
home.packages = (import ./modules/packages.nix { inherit pkgs; })
home.packages = (import ./packages.nix { inherit pkgs; })
++ lib.optionals pkgs.stdenvNoCC.isDarwin
(import ./modules/macos_packages.nix { inherit pkgs; })
(import ./macos_packages.nix { inherit pkgs; })
++ lib.optionals pkgs.stdenvNoCC.isLinux
(import ./modules/linux_packages.nix { inherit pkgs; });
(import ./linux_packages.nix { inherit pkgs; });

xdg = {
enable = true;
configFile = {
# "startpage".source = ./startpage;
"wallpapers/haskell-red-noise.png".source =
./pictures/haskell-red-noise.png;
"wallpapers/doom.svg".source = ./pictures/doomEmacs.svg;
../pictures/haskell-red-noise.png;
"wallpapers/doom.svg".source = ../pictures/doomEmacs.svg;
"wallpapers/nix-wallpaper-dracula.png".source =
./pictures/nix-wallpaper-dracula.png;
../pictures/nix-wallpaper-dracula.png;
};
};
manual.manpages.enable = false;
Expand Down
Loading

0 comments on commit bc2acd7

Please sign in to comment.