feat: add flake support

This commit is contained in:
Ruixi-rebirth 2025-02-25 22:05:29 +08:00
parent 4d48679ccc
commit 1a55178fd6
No known key found for this signature in database
GPG key ID: 847E32F6F2F1D108
7 changed files with 308 additions and 0 deletions

View file

@ -99,6 +99,67 @@ like `MAOMAOCONFIG=/home/xxx/maomao`
- the fallback config path is in `/etc/maomao/config.conf`, you can find the default config here
# NixOS+Home-manager
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
maomaowm.url = "github:DreamMaoMao/maomaowm";
};
outputs =
inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
debug = true;
systems = [ "x86_64-linux" ];
flake = {
nixosConfigurations = {
hostname = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup";
users."username".imports =
[
(
{ ... }:
{
wayland.windowManager.maomaowm = {
enable = true;
settings = ''
# see config.conf
'';
autostart_sh = ''
# see autostart.sh
'';
};
}
)
]
++ [
# Add maomaowm hm module
inputs.maomaowm.hmModules.maomaowm
];
};
}
];
};
};
};
};
}
```
# my dotfile
[maomao-config](https://github.com/DreamMaoMao/dotfile/tree/main/maomao)