Update nix flake, bugfix

This commit is contained in:
2025-01-07 21:55:17 +03:00
parent f0bef5fa2d
commit aa6ba0c07c
2 changed files with 8 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
outputs = { self, nixpkgs }: outputs = { self, nixpkgs }:
let let
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
version = "2.0.0"; version = "2.0.2";
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
@@ -41,7 +41,6 @@
}; };
type = types.attrsOf (types.submodule ({ name, ... }: { type = types.attrsOf (types.submodule ({ name, ... }: {
# freeformType = settingsFormat.type;
options = { options = {
source = mkOption { source = mkOption {
type = types.str; type = types.str;

View File

@@ -243,6 +243,8 @@ func (o *Organizer) getMetadata(fp string, data io.Reader) (metadata.Metadata, e
} }
func (o *Organizer) processFile(sourcePath string) error { func (o *Organizer) processFile(sourcePath string) error {
fmt.Printf("%s %d %o\n", o.fileMode, o.fileMode, o.fileMode)
meta, err := o.getMetaForPath(sourcePath) meta, err := o.getMetaForPath(sourcePath)
if err != nil { if err != nil {
return err return err
@@ -302,9 +304,13 @@ func (o *Organizer) ensureTargetPath(targetPath string) error {
for _, part := range strings.Split(relPath, string(filepath.Separator)) { for _, part := range strings.Split(relPath, string(filepath.Separator)) {
dir = filepath.Join(dir, part) dir = filepath.Join(dir, part)
if err := os.Mkdir(dir, o.dirMode); err != nil && !os.IsExist(err) { if err := os.Mkdir(dir, os.ModePerm); err != nil && !os.IsExist(err) {
return fmt.Errorf("create target directory path at %s: %w", dir, err) return fmt.Errorf("create target directory path at %s: %w", dir, err)
} }
if err := os.Chmod(dir, os.ModePerm&o.dirMode); err != nil {
return fmt.Errorf("chmod directory %s: %w", dir, err)
}
} }
return nil return nil